diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-02 03:10:22 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-02 03:10:22 +0000 |
commit | 2eea15b54cd8b9c2c74b37b5e5b6513e7f84b0a8 (patch) | |
tree | 741ef7642e28772a14df7a3db9d959509e91d4f4 /mod/groups/start.php | |
parent | 740bbc2c7b00f6e409fddff26d7d633caa2ddb9d (diff) | |
download | elgg-2eea15b54cd8b9c2c74b37b5e5b6513e7f84b0a8.tar.gz elgg-2eea15b54cd8b9c2c74b37b5e5b6513e7f84b0a8.tar.bz2 |
Fixes #3104 updated groups plugin to use new menu system for sidebar
git-svn-id: http://code.elgg.org/elgg/trunk@8906 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r-- | mod/groups/start.php | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php index 4eaaa5a7b..b7047144b 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -85,7 +85,7 @@ function groups_init() { elgg_register_event_handler('join', 'group', 'groups_user_join_event_listener'); elgg_register_event_handler('leave', 'group', 'groups_user_leave_event_listener'); - elgg_register_event_handler('pagesetup', 'system', 'groups_submenus'); + elgg_register_event_handler('pagesetup', 'system', 'groups_setup_sidebar_menus'); elgg_register_event_handler('annotate', 'all', 'group_object_notifications'); elgg_register_plugin_hook_handler('access:collections:add_user', 'collection', 'groups_access_collection_override'); @@ -127,10 +127,10 @@ function groups_fields_setup() { } /** - * Sets up submenus for the groups system. Triggered on pagesetup. + * Configure the groups sidebar menu. Triggered on page setup * */ -function groups_submenus() { +function groups_setup_sidebar_menus() { // Get the page owner entity $page_owner = elgg_get_page_owner_entity(); @@ -139,15 +139,30 @@ function groups_submenus() { if ($page_owner instanceof ElggGroup) { if (elgg_is_logged_in() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { $url = elgg_get_site_url() . "groups/requests/{$page_owner->getGUID()}"; - add_submenu_item(elgg_echo('groups:membershiprequests'), $url, 'groupsactions1'); + elgg_register_menu_item('page', array( + 'name' => 'membership_requests', + 'text' => elgg_echo('groups:membershiprequests'), + 'href' => $url, + )); } } else { - add_submenu_item(elgg_echo('groups:all'), "groups/all", 'groupslinks1'); - - if ($user = elgg_get_logged_in_user_entity()) { - add_submenu_item(elgg_echo('groups:owned'), "groups/owner/$user->username", 'groupslinks1'); - add_submenu_item(elgg_echo('groups:yours'), "groups/member/$user->username", 'groupslinks1'); - add_submenu_item(elgg_echo('groups:invitations'), "groups/invitations/$user->username", 'groupslinks1'); + elgg_register_menu_item('page', array( + 'name' => 'groups:all', + 'text' => elgg_echo('groups:all'), + 'href' => 'groups/all', + )); + + $user = elgg_get_logged_in_user_entity(); + if ($user) { + $url = "groups/owner/$user->username"; + $item = new ElggMenuItem('groups:owned', elgg_echo('groups:owned'), $url); + elgg_register_menu_item('page', $item); + $url = "groups/member/$user->username"; + $item = new ElggMenuItem('groups:member', elgg_echo('groups:yours'), $url); + elgg_register_menu_item('page', $item); + $url = "groups/invitations/$user->username"; + $item = new ElggMenuItem('groups:user:invites', elgg_echo('groups:invitations'), $url); + elgg_register_menu_item('page', $item); } } } |