diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-07-14 14:01:47 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-07-14 14:01:47 +0000 |
commit | ff07d7f469b8f50f9ab96e040354af6bc7ccc706 (patch) | |
tree | ef60b24ac2f1ceffc4b45c1abeee5e64b03c1282 /mod/groups/views | |
parent | 7dc6d802a7c4d6d936cbd6ec6a4837a109c72268 (diff) | |
download | elgg-ff07d7f469b8f50f9ab96e040354af6bc7ccc706.tar.gz elgg-ff07d7f469b8f50f9ab96e040354af6bc7ccc706.tar.bz2 |
Admin users can join groups. Don't request to join a closed group if admin.
git-svn-id: http://code.elgg.org/elgg/trunk@6702 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views')
-rw-r--r-- | mod/groups/views/default/groups/groupprofile.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/mod/groups/views/default/groups/groupprofile.php b/mod/groups/views/default/groups/groupprofile.php index ab1990370..13b244f88 100644 --- a/mod/groups/views/default/groups/groupprofile.php +++ b/mod/groups/views/default/groups/groupprofile.php @@ -15,6 +15,7 @@ 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}"); @@ -22,24 +23,33 @@ if ($vars['entity']->canEdit()) { // 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)) { +} + +if ($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'); + // join + // admins can always join. + if ($vars['entity']->isPublicMembership() || $vars['entity']->canEdit()) { + $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 +/* + +*/ + +// build action buttons $action_buttons = ''; if (!empty($actions)) { $action_buttons = '<div class="content_header_options">'; |