From 05cd3a5f331d271a0a93d2bee69fdd70494f32d6 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 23 Mar 2011 00:07:36 +0000 Subject: added an owner block link for the wire plugin git-svn-id: http://code.elgg.org/elgg/trunk@8819 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/thewire/start.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mod/thewire') diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 0b2265082..d10efb6ba 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -27,6 +27,9 @@ function thewire_init() { $item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all'); elgg_register_menu_item('site', $item); + // owner block menu + elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu'); + // remove edit and access and add thread, reply, view previous elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items'); @@ -411,6 +414,19 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) { return $value; } +/** + * Add a menu item to an ownerblock + */ +function thewire_owner_block_menu($hook, $type, $return, $params) { + if (elgg_instanceof($params['entity'], 'user')) { + $url = "thewire/owner/{$params['entity']->username}"; + $item = new ElggMenuItem('thewire', elgg_echo('item:object:thewire'), $url); + $return[] = $item; + } + + return $return; +} + /** * Runs unit tests for the wire */ -- cgit v1.2.3