3 * StatusNet, the distributed open-source microblogging tool
5 * List of group members
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 * @copyright 2008-2009 StatusNet, Inc.
26 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
27 * @link http://status.net/
30 if (!defined('STATUSNET') && !defined('LACONICA')) {
34 require_once(INSTALLDIR.'/lib/profilelist.php');
35 require_once INSTALLDIR.'/lib/publicgroupnav.php';
38 * List of group members
42 * @author Evan Prodromou <evan@status.net>
43 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
44 * @link http://status.net/
46 class GroupmembersAction extends GroupAction
50 function isReadOnly($args)
55 function prepare($args)
57 parent::prepare($args);
59 $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
66 if ($this->page == 1) {
67 // TRANS: Title of the page showing group members.
68 // TRANS: %s is the name of the group.
69 return sprintf(_('%s group members'),
70 $this->group->nickname);
72 // TRANS: Title of the page showing group members.
73 // TRANS: %1$s is the name of the group, %2$d is the page number of the members list.
74 return sprintf(_('%1$s group members, page %2$d'),
75 $this->group->nickname,
80 function handle($args)
82 parent::handle($args);
86 function showPageNotice()
88 $this->element('p', 'instructions',
89 // TRANS: Page notice for group members page.
90 _('A list of the users in this group.'));
93 function showContent()
95 $offset = ($this->page-1) * PROFILES_PER_PAGE;
96 $limit = PROFILES_PER_PAGE + 1;
100 $members = $this->group->getMembers($offset, $limit);
103 $member_list = new GroupMemberList($members, $this->group, $this);
104 $cnt = $member_list->show();
109 $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
110 $this->page, 'groupmembers',
111 array('nickname' => $this->group->nickname));