diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-27 02:14:56 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-27 02:14:56 +0000 |
commit | 543e50d2aabfbd3c116cbb670018c66fae535955 (patch) | |
tree | d84b51988a755c03f8794e3c11cf38b78015ea65 /mod | |
parent | 07a1585f3eee1211aeaf55ea436135f637520102 (diff) | |
download | elgg-543e50d2aabfbd3c116cbb670018c66fae535955.tar.gz elgg-543e50d2aabfbd3c116cbb670018c66fae535955.tar.bz2 |
moved most of the code for the user hover menu into the new menu system
git-svn-id: http://code.elgg.org/elgg/trunk@7723 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/logbrowser/start.php | 11 | ||||
-rw-r--r-- | mod/messages/start.php | 15 |
2 files changed, 20 insertions, 6 deletions
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index 1eda00732..62beafe87 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -14,18 +14,19 @@ function logbrowser_init() { elgg_extend_view('css/admin', 'logbrowser/css'); - elgg_register_plugin_hook_handler('register', 'menu:user_admin', 'logbrowser_user_admin_menu'); + elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu'); elgg_add_admin_submenu_item('logbrowser', elgg_echo('logbrowser'), 'overview'); } /** - * Add to the user admin menu + * Add to the user hover menu */ -function logbrowser_user_admin_menu($hook, $type, $return, $params) { +function logbrowser_user_hover_menu($hook, $type, $return, $params) { $user = $params['user']; $url = "pg/admin/overview/logbrowser/?user_guid={$user->guid}"; $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url); - elgg_register_menu_item('user_admin', $item); -}
\ No newline at end of file + $item->setSection('admin'); + elgg_register_menu_item('user_hover', $item); +} diff --git a/mod/messages/start.php b/mod/messages/start.php index 3459bb9f8..861f219b2 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -30,7 +30,7 @@ function messages_init() { register_entity_url_handler('messages_url', 'object', 'messages'); // Extend avatar hover menu - elgg_extend_view('profile/menu/links', 'messages/menu'); + elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu'); // Register a notification handler for site messages register_notification_handler("site", "messages_site_notify_handler"); @@ -308,6 +308,19 @@ function messages_site_notify_handler(ElggEntity $from, ElggUser $to, $subject, } /** + * Add to the user hover menu + */ +function messages_user_hover_menu($hook, $type, $return, $params) { + $user = $params['user']; + + $url = "mod/messages/send.php?send_to={$user->guid}"; + $item = new ElggMenuItem('logbrowser', elgg_echo('messages:sendmessage'), $url); + $item->setSection('action'); + elgg_register_menu_item('user_hover', $item); +} + + +/** * Register messages with ECML. * * @param string $hook |