From: Brion Vibber Date: Tue, 22 Mar 2011 00:23:13 +0000 (-0700) Subject: Add pending members list to group navigation, if group has joins moderated or if... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=61960d36687cba7b4ace801fdd65829314bc0a13;p=quix0rs-gnu-social.git Add pending members list to group navigation, if group has joins moderated or if it has pending requests open --- diff --git a/lib/groupnav.php b/lib/groupnav.php index a2dd6eac00..6a4f5f7e30 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -100,6 +100,18 @@ class GroupNav extends Menu $cur = common_current_user(); if ($cur && $cur->isAdmin($this->group)) { + $pending = $this->countPendingMembers(); + if ($pending || $this->group->join_policy == User_group::JOIN_POLICY_MODERATE) { + $this->out->menuItem(common_local_url('groupqueue', array('nickname' => + $nickname)), + // TRANS: Menu item in the group navigation page. Only shown for group administrators. + sprintf(_m('MENU','Pending members (%d)'), $pending), + // TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators. + // TRANS: %s is the nickname of the group. + sprintf(_m('TOOLTIP','%s pending members'), $nickname), + $action_name == 'groupqueue', + 'nav_group_pending'); + } $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' => $nickname)), // TRANS: Menu item in the group navigation page. Only shown for group administrators. @@ -141,4 +153,11 @@ class GroupNav extends Menu } $this->out->elementEnd('ul'); } + + function countPendingMembers() + { + $req = new Group_join_queue(); + $req->group_id = $this->group->id; + return $req->count(); + } }