diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /mod/groups/lib/groups.php | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'mod/groups/lib/groups.php')
-rw-r--r-- | mod/groups/lib/groups.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index 86e6f018e..7798e5dc3 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -24,6 +24,9 @@ function groups_handle_all_page() { 'inverse_relationship' => false, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } break; case 'discussion': $content = elgg_list_entities(array( @@ -33,6 +36,9 @@ function groups_handle_all_page() { 'limit' => 40, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('discussion:none'); + } break; case 'newest': default: @@ -40,6 +46,9 @@ function groups_handle_all_page() { 'type' => 'group', 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } break; } @@ -107,6 +116,9 @@ function groups_handle_owned_page() { 'owner_guid' => elgg_get_page_owner_guid(), 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } $params = array( 'content' => $content, @@ -137,6 +149,9 @@ function groups_handle_mine_page() { 'inverse_relationship' => false, 'full_view' => false, )); + if (!$content) { + $content = elgg_echo('groups:none'); + } $params = array( 'content' => $content, @@ -388,9 +403,11 @@ function groups_handle_requests_page($guid) { elgg_push_breadcrumb($title); $requests = elgg_get_entities_from_relationship(array( + 'type' => 'user', 'relationship' => 'membership_request', 'relationship_guid' => $guid, 'inverse_relationship' => true, + 'limit' => 0, )); $content = elgg_view('groups/membershiprequests', array( 'requests' => $requests, @@ -430,12 +447,14 @@ function groups_register_profile_buttons($group) { } // 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->isMember(elgg_get_logged_in_user_entity())) { + 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); |