aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-08 20:58:13 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-08 20:58:13 +0000
commitb6ec22721c68bd12db74c0bb9e55482e17f4e58e (patch)
tree4029d988ddf0abea681dca40620b82373f5eba48 /mod/groups/views/default
parentdb13e59b797dcbb06d3849033a752ffc7d12e62c (diff)
downloadelgg-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/views/default')
-rw-r--r--mod/groups/views/default/groups/groupprofile.php64
1 files changed, 51 insertions, 13 deletions
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 = '<div class="content_header_options">';
+ foreach ($actions as $url => $action) {
+ $action_buttons .= "<a class=\"action_button\" href=\"{$vars['url']}$url\">$action</a>";
+ }
+ $action_buttons .= '</div>';
+}
+
+// display breadcrumb
+elgg_push_breadcrumb($vars['entity']->name);
+echo elgg_view('navigation/breadcrumbs');
+
+// build and display header
+echo <<<__HTML
<div id="content_header" class="clearfloat">
<div class="content_header_title">
- <h2><?php echo $vars['entity']->name; ?></h2>
+ <h2>{$vars['entity']->name}</h2>
</div>
- <?php
- if ($vars['entity']->canEdit()) {
- ?>
- <div class="content_header_options">
- <a class="action_button" href="<?php echo $vars['url']; ?>mod/groups/edit.php?group_guid=<?php echo $vars['entity']->getGUID(); ?>"><?php echo elgg_echo("groups:edit"); ?></a>
- </div>
- <?php
- }
- ?>
+ $action_buttons
</div>
+__HTML;
+?>
<div class="group_profile clearfloat">
<div class="group_profile_column icon">
<div class="group_profile_icon">
@@ -94,5 +134,3 @@
?>
</div>
</div>
-
-