From: Duck (Jakob Munih) Date: Mon, 23 Feb 2009 18:56:43 +0000 (+0100) Subject: Add people you might know block X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6271edd884075c69a5d9f337adff5b4b9bae94d5;p=horde.git Add people you might know block --- diff --git a/folks/lib/Block/know.php b/folks/lib/Block/know.php new file mode 100644 index 000000000..2f49e033a --- /dev/null +++ b/folks/lib/Block/know.php @@ -0,0 +1,61 @@ + + */ +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