diff options
Diffstat (limited to 'mod/groups/lib/groups.php')
-rw-r--r-- | mod/groups/lib/groups.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index 126738566..4e2b045a6 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -17,7 +17,7 @@ function groups_handle_all_page() { $selected_tab = get_input('filter', 'newest'); switch ($selected_tab) { - case 'pop': + case 'popular': $content = elgg_list_entities_from_relationship_count(array( 'type' => 'group', 'relationship' => 'member', @@ -25,7 +25,7 @@ function groups_handle_all_page() { 'full_view' => false, )); break; - case 'active': + case 'discussion': $content = elgg_list_entities(array( 'type' => 'object', 'subtype' => 'groupforumtopic', @@ -198,7 +198,7 @@ function groups_handle_invitations_page() { elgg_push_breadcrumb($title); // @todo temporary workaround for exts #287. - $invitations = groups_get_invited_groups($user->getGUID()); + $invitations = groups_get_invited_groups(elgg_get_logged_in_user_guid()); $content = elgg_view('groups/invitationrequests', array('invitations' => $invitations)); $params = array( @@ -424,18 +424,20 @@ function groups_register_profile_buttons($group) { if ($group->canEdit()) { // edit and invite $url = elgg_get_site_url() . "groups/edit/{$group->getGUID()}"; - $actions[$url] = elgg_echo('groups:edit'); + $actions[$url] = 'groups:edit'; $url = elgg_get_site_url() . "groups/invite/{$group->getGUID()}"; - $actions[$url] = elgg_echo('groups:invite'); + $actions[$url] = 'groups:invite'; } // group members if ($group->isMember($user)) { - // leave - $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; - $url = elgg_add_action_tokens_to_url($url); - $actions[$url] = 'groups:leave'; - } else { + if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { + // leave + $url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; + $url = elgg_add_action_tokens_to_url($url); + $actions[$url] = 'groups:leave'; + } + } elseif (elgg_is_logged_in()) { // join - admins can always join. $url = elgg_get_site_url() . "action/groups/join?group_guid={$group->getGUID()}"; $url = elgg_add_action_tokens_to_url($url); |