aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/lib
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/groups/lib
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/groups/lib')
-rw-r--r--mod/groups/lib/discussion.php5
-rw-r--r--mod/groups/lib/groups.php31
2 files changed, 29 insertions, 7 deletions
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index e129e0f9d..2bda4678e 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -60,6 +60,9 @@ function discussion_handle_list_page($guid) {
'full_view' => false,
);
$content = elgg_list_entities($options);
+ if (!$content) {
+ $content = elgg_echo('discussion:none');
+ }
$params = array(
@@ -189,7 +192,7 @@ function discussion_handle_view_page($guid) {
);
$body = elgg_view_layout('content', $params);
- echo elgg_view_page($title, $body);
+ echo elgg_view_page($topic->title, $body);
}
/**
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);