]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/groupmembers.php
Fix noticesearch tag regex
[quix0rs-gnu-social.git] / actions / groupmembers.php
1 <?php
2 /**
3  * StatusNet, the distributed open-source microblogging tool
4  *
5  * List of group members
6  *
7  * PHP version 5
8  *
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.
13  *
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.
18  *
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/>.
21  *
22  * @category  Group
23  * @package   StatusNet
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/
28  */
29
30 if (!defined('GNUSOCIAL')) { exit(1); }
31
32 /**
33  * List of group members
34  *
35  * @category Group
36  * @package  StatusNet
37  * @author   Evan Prodromou <evan@status.net>
38  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
39  * @link     http://status.net/
40  */
41 class GroupmembersAction extends GroupAction
42 {
43     var $page = null;
44
45     function isReadOnly($args)
46     {
47         return true;
48     }
49
50     function title()
51     {
52         if ($this->page == 1) {
53             // TRANS: Title of the page showing group members.
54             // TRANS: %s is the name of the group.
55             return sprintf(_('%s group members'),
56                            $this->group->nickname);
57         } else {
58             // TRANS: Title of the page showing group members.
59             // TRANS: %1$s is the name of the group, %2$d is the page number of the members list.
60             return sprintf(_('%1$s group members, page %2$d'),
61                            $this->group->nickname,
62                            $this->page);
63         }
64     }
65
66     protected function handle()
67     {
68         parent::handle();
69         $this->showPage();
70     }
71
72     function showPageNotice()
73     {
74         $this->element('p', 'instructions',
75                        // TRANS: Page notice for group members page.
76                        _('A list of the users in this group.'));
77     }
78
79     function showContent()
80     {
81         $offset = ($this->page-1) * PROFILES_PER_PAGE;
82         $limit =  PROFILES_PER_PAGE + 1;
83
84         $cnt = 0;
85
86         $members = $this->group->getMembers($offset, $limit);
87
88         if ($members) {
89             $member_list = new GroupMemberList($members, $this->group, $this);
90             $cnt = $member_list->show();
91         }
92
93         $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
94                           $this->page, 'groupmembers',
95                           array('nickname' => $this->group->nickname));
96     }
97 }