]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/peopletagnav.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / lib / peopletagnav.php
1 <?php
2 /**
3  * StatusNet, the distributed open-source microblogging tool
4  *
5  * Tabset for a particular list
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  Action
23  * @package   StatusNet
24  * @author    Shashi Gowda <connect2shashi@gmail.com>
25  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
26  * @link      http://status.net/
27  */
28
29 if (!defined('STATUSNET') && !defined('LACONICA')) {
30     exit(1);
31 }
32
33 require_once INSTALLDIR.'/lib/widget.php';
34
35 /**
36  * Tabset for a group
37  *
38  * Shows a group of tabs for a particular user group
39  *
40  * @category Output
41  * @package  StatusNet
42  * @author   Shashi Gowda <connect2shashi@gmail.com>
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/
45  *
46  * @see      HTMLOutputter
47  */
48 class PeopletagNav extends Menu
49 {
50     var $group = null;
51
52     /**
53      * Construction
54      *
55      * @param Action $action current action, used for output
56      */
57     function __construct($action=null, $profile=null)
58     {
59         parent::__construct($action);
60         $this->profile = $profile;
61     }
62
63     /**
64      * Show the menu
65      *
66      * @return void
67      */
68     function show()
69     {
70         $action_name = $this->action->trimmed('action');
71         $nickname = $this->profile->nickname;
72
73         $this->out->elementStart('ul', array('class' => 'nav'));
74         if (Event::handle('StartPeopletagGroupNav', array($this))) {
75             $this->out->menuItem(common_local_url('peopletagsubscriptions', array('nickname' =>
76                                                                      $nickname)),
77                                  // TRANS: Menu item in the group navigation page.
78                                  _m('MENU','List Subscriptions'),
79                                  // TRANS: Tooltip for menu item in the group navigation page.
80                                  // TRANS: %s is a user nickname.
81                                  sprintf(_m('TOOLTIP','Lists subscribed to by %s.'), $nickname),
82                                  $action_name == 'peopletagsubscriptions',
83                                  'nav_list_group');
84             $this->out->menuItem(common_local_url('peopletagsforuser', array('nickname' =>
85                                                                         $nickname)),
86                                  // TRANS: Menu item in the group navigation page.
87                                  // TRANS: %s is a user nickname.
88                                  sprintf(_m('MENU','Lists with %s'), $nickname),
89                                  // TRANS: Tooltip for menu item in the group navigation page.
90                                  // TRANS: %s is a user nickname.
91                                  sprintf(_m('TOOLTIP','Lists with %s.'), $nickname),
92                                  $action_name == 'peopletagsforuser',
93                                  'nav_lists_with');
94             $this->out->menuItem(common_local_url('peopletagsbyuser', array('nickname' =>
95                                                                         $nickname)),
96                                  // TRANS: Menu item in the group navigation page.
97                                  // TRANS: %s is a user nickname.
98                                  sprintf(_m('MENU','Lists by %s'), $nickname),
99                                  // TRANS: Tooltip for menu item in the group navigation page.
100                                  // TRANS: %s is a user nickname.
101                                  sprintf(_m('TOOLTIP','Lists by %s.'), $nickname),
102                                  $action_name == 'peopletagsbyuser',
103                                  'nav_lists_by');
104             Event::handle('EndGroupGroupNav', array($this));
105         }
106         $this->out->elementEnd('ul');
107     }
108 }