diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-08 20:58:13 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-08 20:58:13 +0000 |
commit | b6ec22721c68bd12db74c0bb9e55482e17f4e58e (patch) | |
tree | 4029d988ddf0abea681dca40620b82373f5eba48 /mod/groups/start.php | |
parent | db13e59b797dcbb06d3849033a752ffc7d12e62c (diff) | |
download | elgg-b6ec22721c68bd12db74c0bb9e55482e17f4e58e.tar.gz elgg-b6ec22721c68bd12db74c0bb9e55482e17f4e58e.tar.bz2 |
Cleaning up groups navigation.
Action buttons have replaced the submenu links, helping to standardize user experience.
Added a membership-dependent breadcrumb trail.
git-svn-id: http://code.elgg.org/elgg/trunk@6407 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r-- | mod/groups/start.php | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php index fdf3b9e45..7c6d39b9d 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -195,50 +195,27 @@ * */ function groups_submenus() { - global $CONFIG; // Get the page owner entity - $page_owner = page_owner_entity(); - - // Submenu items for all group pages - if ($page_owner instanceof ElggGroup && get_context() == 'groups') { - if (isloggedin()) { - if ($page_owner->canEdit()) { - add_submenu_item(elgg_echo('groups:invite'),$CONFIG->wwwroot . "mod/groups/invite.php?group_guid={$page_owner->getGUID()}", '1groupsactions'); - if (!$page_owner->isPublicMembership()) - add_submenu_item(elgg_echo('groups:membershiprequests'),$CONFIG->wwwroot . "mod/groups/membershipreq.php?group_guid={$page_owner->getGUID()}", '1groupsactions'); - } - if ($page_owner->isMember($_SESSION['user'])) { - if ($page_owner->getOwner() != $_SESSION['guid']) { - $url = elgg_add_action_tokens_to_url($CONFIG->wwwroot . "action/groups/leave?group_guid=" . $page_owner->getGUID()); - add_submenu_item(elgg_echo('groups:leave'), $url, '1groupsactions'); - } - } else { - if ($page_owner->isPublicMembership()) { - $url = elgg_add_action_tokens_to_url($CONFIG->wwwroot . "action/groups/join?group_guid={$page_owner->getGUID()}"); - add_submenu_item(elgg_echo('groups:join'), $url, '1groupsactions'); - } else { - $url = elgg_add_action_tokens_to_url($CONFIG->wwwroot . "action/groups/joinrequest?group_guid={$page_owner->getGUID()}"); - add_submenu_item(elgg_echo('groups:joinrequest'), $url, '1groupsactions'); - } - } - } - } + $page_owner = page_owner_entity(); - // Add submenu options - if (get_context() == 'groups' && !($page_owner instanceof ElggGroup)) { - if (isloggedin()) { - add_submenu_item(elgg_echo('groups:owned'), $CONFIG->wwwroot . "pg/groups/owned/" . $_SESSION['user']->username, '1groupslinks'); - add_submenu_item(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/" . $_SESSION['user']->username, '1groupslinks'); + if (get_context() == 'groups') { + if ($page_owner instanceof ElggGroup) { + if (isloggedin() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { + $url = "{$CONFIG->wwwroot}mod/groups/membershipreq.php?group_guid={$page_owner->getGUID()}"; + add_submenu_item(elgg_echo('groups:membershiprequests'), $url, '1groupsactions'); } - add_submenu_item(elgg_echo('groups:all'), $CONFIG->wwwroot . "pg/groups/world/", '1groupslinks'); - - if (isloggedin()) { - add_submenu_item(elgg_echo('groups:invitations'), $CONFIG->wwwroot . "pg/groups/invitations/" . $_SESSION['user']->username, '1groupslinks'); + } else { + add_submenu_item(elgg_echo('groups:all'), "{$CONFIG->wwwroot}pg/groups/world/", '1groupslinks'); + + if ($user = get_loggedin_user()) { + add_submenu_item(elgg_echo('groups:owned'), "{$CONFIG->wwwroot}pg/groups/owned/$user->username", '1groupslinks'); + add_submenu_item(elgg_echo('groups:yours'), "{$CONFIG->wwwroot}pg/groups/member/$user->username", '1groupslinks'); + add_submenu_item(elgg_echo('groups:invitations'), "{$CONFIG->wwwroot}pg/groups/invitations/$user->username", '1groupslinks'); } } - + } } /** |