store the block I was working on here also
authorChuck Hagenbuch <chuck@horde.org>
Thu, 4 Dec 2008 16:56:55 +0000 (11:56 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 4 Dec 2008 16:57:54 +0000 (11:57 -0500)
framework/Service_Scribd/lib/Horde/Block/Scribd.php [new file with mode: 0644]

diff --git a/framework/Service_Scribd/lib/Horde/Block/Scribd.php b/framework/Service_Scribd/lib/Horde/Block/Scribd.php
new file mode 100644 (file)
index 0000000..3ac6679
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * @package Horde_Block
+ */
+class Horde_Block_Horde_Scribd extends Horde_Block {
+
+    var $_app = 'horde';
+
+    function _params()
+    {
+    }
+
+    /**
+     * The title to go in this block.
+     *
+     * @return string   The title text.
+     */
+    function _title()
+    {
+        return _("Scribd Documents");
+    }
+
+    /**
+     * The content to go in this block.
+     *
+     * @return string   The content
+     */
+    function _content()
+    {
+        $docs = $this->_list();
+        if (is_array($this->_docs)) {
+            $html = '';
+            $count = 0;
+            foreach ($this->_feed as $entry) {
+                if ($count++ > $this->_params['limit']) {
+                    break;
+                }
+                $html .= '<a href="' . $entry->link. '"';
+                if (empty($this->_params['details'])) {
+                    $html .= ' title="' . htmlspecialchars(strip_tags($entry->description())) . '"';
+                }
+                $html .= '>' . htmlspecialchars($entry->title) . '</a>';
+                if (!empty($this->_params['details'])) {
+                    $html .= '<br />' .  htmlspecialchars(strip_tags($entry->description())). "<br />\n";
+                }
+                $html .= '<br />';
+            }
+            return $html;
+        } elseif (is_string($docs)) {
+            return $docs;
+        } else {
+            return '';
+        }
+    }
+
+    function _list()
+    {
+    }
+
+}