aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/start.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-16 11:48:34 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-02-16 11:48:34 -0200
commitb6ee1b93376d42f8a8fcee0127bc10f84d1e018e (patch)
treecbde5e4d0b745c3bb854c215bccea8b2d6bb367e /mod/groups/start.php
parent694306cf537fb8cb45beb7d4fd63c5b56cb5c4da (diff)
parent5aff5b3913fbb6226d8fb3162453c58888fba38d (diff)
downloadelgg-b6ee1b93376d42f8a8fcee0127bc10f84d1e018e.tar.gz
elgg-b6ee1b93376d42f8a8fcee0127bc10f84d1e018e.tar.bz2
Merge branch 'master' into saravea
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r--mod/groups/start.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 9dca7dc16..4e49d9e55 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -144,9 +144,24 @@ function groups_setup_sidebar_menus() {
if (elgg_in_context('group_profile')) {
if (elgg_is_logged_in() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) {
$url = elgg_get_site_url() . "groups/requests/{$page_owner->getGUID()}";
+
+ $count = elgg_get_entities_from_relationship(array(
+ 'type' => 'user',
+ 'relationship' => 'membership_request',
+ 'relationship_guid' => $guid,
+ 'inverse_relationship' => true,
+ 'count' => true,
+ ));
+
+ if ($count) {
+ $text = elgg_echo('groups:membershiprequests:pending', array($count));
+ } else {
+ $text = elgg_echo('groups:membershiprequests');
+ }
+
elgg_register_menu_item('page', array(
'name' => 'membership_requests',
- 'text' => elgg_echo('groups:membershiprequests'),
+ 'text' => $text,
'href' => $url,
));
}
@@ -163,11 +178,21 @@ function groups_setup_sidebar_menus() {
$url = "groups/owner/$user->username";
$item = new ElggMenuItem('groups:owned', elgg_echo('groups:owned'), $url);
elgg_register_menu_item('page', $item);
+
$url = "groups/member/$user->username";
$item = new ElggMenuItem('groups:member', elgg_echo('groups:yours'), $url);
elgg_register_menu_item('page', $item);
+
$url = "groups/invitations/$user->username";
- $item = new ElggMenuItem('groups:user:invites', elgg_echo('groups:invitations'), $url);
+ $invitations = groups_get_invited_groups($user->getGUID());
+ if (is_array($invitations) && !empty($invitations)) {
+ $invitation_count = count($invitations);
+ $text = elgg_echo('groups:invitations:pending', array($invitation_count));
+ } else {
+ $text = elgg_echo('groups:invitations');
+ }
+
+ $item = new ElggMenuItem('groups:user:invites', $text, $url);
elgg_register_menu_item('page', $item);
}
}