Add people you might know block
authorDuck (Jakob Munih) <duck@obala.net>
Mon, 23 Feb 2009 18:56:43 +0000 (19:56 +0100)
committerDuck (Jakob Munih) <duck@obala.net>
Mon, 23 Feb 2009 18:56:43 +0000 (19:56 +0100)
folks/lib/Block/know.php [new file with mode: 0644]

diff --git a/folks/lib/Block/know.php b/folks/lib/Block/know.php
new file mode 100644 (file)
index 0000000..2f49e03
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+
+$block_name = _("People you might know");
+
+/**
+ * $Id: friends.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * @package Folks
+ * @author Duck <duck@obala.net>
+ */
+class Horde_Block_Folks_know extends Horde_Block {
+
+    var $_app = 'folks';
+
+    /**
+     * The title to go in this block.
+     *
+     * @return string   The title text.
+     */
+    function _title()
+    {
+        return _("People you might know");
+    }
+
+    /**
+     * The content to go in this block.
+     *
+     * @return string   The content
+     */
+    function _content()
+    {
+        require_once dirname(__FILE__) . '/../base.php';
+        require_once FOLKS_BASE . '/lib/Friends.php';
+
+        $friends_driver = Folks_Friends::singleton();
+        $list = $friends_driver->getPossibleFriends(20);
+        if ($list instanceof PEAR_Error) {
+            return $list;
+        }
+
+        // Prepare actions
+        $actions = array(
+            array('url' => Horde::applicationUrl('edit/friends/add.php'),
+                'id' => 'user',
+                'name' => _("Add friend")),
+            array('url' => Horde::applicationUrl('user.php'),
+                'id' => 'user',
+                'name' => _("View profile")));
+        if ($GLOBALS['registry']->hasInterface('letter')) {
+            $actions[] = array('url' => $GLOBALS['registry']->callByPackage('letter', 'compose', ''),
+                                'id' => 'user_to',
+                                'name' => _("Send message"));
+        }
+
+        Horde::addScriptFile('stripe.js', 'horde', true);
+
+        ob_start();
+        require FOLKS_TEMPLATES . '/block/users.php';
+        return ob_get_clean();
+    }
+}
\ No newline at end of file