3 * StatusNet, the distributed open-source microblogging tool
5 * Tabset for a particular group
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@status.net>
25 * @author Sarven Capadisli <csarven@status.net>
26 * @copyright 2008 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
35 require_once INSTALLDIR.'/lib/widget.php';
40 * Shows a group of tabs for a particular user group
44 * @author Evan Prodromou <evan@status.net>
45 * @author Sarven Capadisli <csarven@status.net>
46 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
47 * @link http://status.net/
52 class GroupNav extends Widget
60 * @param Action $action current action, used for output
63 function __construct($action=null, $group=null)
65 parent::__construct($action);
66 $this->action = $action;
67 $this->group = $group;
78 $action_name = $this->action->trimmed('action');
79 $nickname = $this->group->nickname;
81 $this->out->elementStart('ul', array('class' => 'nav'));
82 if (Event::handle('StartGroupGroupNav', array($this))) {
83 $this->out->menuItem(common_local_url('showgroup', array('nickname' =>
85 // TRANS: Menu item in the group navigation page.
87 // TRANS: Tooltip for menu item in the group navigation page.
88 // TRANS: %s is the nickname of the group.
89 sprintf(_m('TOOLTIP','%s group'), $nickname),
90 $action_name == 'showgroup',
92 $this->out->menuItem(common_local_url('groupmembers', array('nickname' =>
94 // TRANS: Menu item in the group navigation page.
96 // TRANS: Tooltip for menu item in the group navigation page.
97 // TRANS: %s is the nickname of the group.
98 sprintf(_m('TOOLTIP','%s group members'), $nickname),
99 $action_name == 'groupmembers',
100 'nav_group_members');
102 $cur = common_current_user();
104 if ($cur && $cur->isAdmin($this->group)) {
105 $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' =>
107 // TRANS: Menu item in the group navigation page. Only shown for group administrators.
108 _m('MENU','Blocked'),
109 // TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
110 // TRANS: %s is the nickname of the group.
111 sprintf(_m('TOOLTIP','%s blocked users'), $nickname),
112 $action_name == 'blockedfromgroup',
113 'nav_group_blocked');
114 $this->out->menuItem(common_local_url('editgroup', array('nickname' =>
116 // TRANS: Menu item in the group navigation page. Only shown for group administrators.
118 // TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
119 // TRANS: %s is the nickname of the group.
120 sprintf(_m('TOOLTIP','Edit %s group properties'), $nickname),
121 $action_name == 'editgroup',
123 $this->out->menuItem(common_local_url('grouplogo', array('nickname' =>
125 // TRANS: Menu item in the group navigation page. Only shown for group administrators.
127 // TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
128 // TRANS: %s is the nickname of the group.
129 sprintf(_m('TOOLTIP','Add or edit %s logo'), $nickname),
130 $action_name == 'grouplogo',
132 $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' =>
134 // TRANS: Menu item in the group navigation page. Only shown for group administrators.
136 // TRANS: Tooltip for menu item in the group navigation page. Only shown for group administrators.
137 // TRANS: %s is the nickname of the group.
138 sprintf(_m('TOOLTIP','Add or edit %s design'), $nickname),
139 $action_name == 'groupdesignsettings',
142 Event::handle('EndGroupGroupNav', array($this));
144 $this->out->elementEnd('ul');