From b6ec22721c68bd12db74c0bb9e55482e17f4e58e Mon Sep 17 00:00:00 2001 From: nickw Date: Tue, 8 Jun 2010 20:58:13 +0000 Subject: 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 --- mod/groups/views/default/groups/groupprofile.php | 64 +++++++++++++++++++----- 1 file changed, 51 insertions(+), 13 deletions(-) (limited to 'mod/groups/views/default') diff --git a/mod/groups/views/default/groups/groupprofile.php b/mod/groups/views/default/groups/groupprofile.php index f1ca92e4e..ab1990370 100644 --- a/mod/groups/views/default/groups/groupprofile.php +++ b/mod/groups/views/default/groups/groupprofile.php @@ -8,22 +8,62 @@ * @copyright Curverider Ltd 2008-2010 * @link http://elgg.com/ */ -?> + + +$user = get_loggedin_user(); +elgg_push_breadcrumb(elgg_echo('groups:all'), "{$vars['url']}pg/groups/world"); + +// create user actions +$actions = array(); +if ($vars['entity']->canEdit()) { + // breadcrumb trail + elgg_push_breadcrumb(elgg_echo('groups:yours'), "{$vars['url']}pg/groups/member/{$user->username}"); + + // edit and invite + $actions["mod/groups/edit.php?group_guid={$vars['entity']->getGUID()}"] = elgg_echo('groups:edit'); + $actions["mod/groups/invite.php?group_guid={$vars['entity']->getGUID()}"] = elgg_echo('groups:invite'); +} elseif ($vars['entity']->isMember($user)) { + // breadcrumb trail + elgg_push_breadcrumb(elgg_echo('groups:yours'), "{$vars['url']}pg/groups/member/{$user->username}"); + + // leave + $url = elgg_add_action_tokens_to_url("action/groups/leave?group_guid={$vars['entity']->getGUID()}"); + $actions[$url] = elgg_echo('groups:leave'); +} elseif ($vars['entity']->isPublicMembership()) { + // join + $url = elgg_add_action_tokens_to_url("action/groups/join?group_guid={$vars['entity']->getGUID()}"); + $actions[$url] = elgg_echo('groups:join'); +} else { + // request membership + $url = elgg_add_action_tokens_to_url("action/groups/joinrequest?group_guid={$vars['entity']->getGUID()}"); + $actions[$url] = elgg_echo('groups:joinrequest'); +} + +// build aciton buttons +$action_buttons = ''; +if (!empty($actions)) { + $action_buttons = '
'; + foreach ($actions as $url => $action) { + $action_buttons .= "$action"; + } + $action_buttons .= '
'; +} + +// display breadcrumb +elgg_push_breadcrumb($vars['entity']->name); +echo elgg_view('navigation/breadcrumbs'); + +// build and display header +echo <<<__HTML
-

name; ?>

+

{$vars['entity']->name}

- canEdit()) { - ?> -
- -
- + $action_buttons
+__HTML; +?>
@@ -94,5 +134,3 @@ ?>
- - -- cgit v1.2.3