git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

publicgroupnav.php 4.05 KB
Newer Older
1 2
<?php
/**
3
 * StatusNet, the distributed open-source microblogging tool
4
 *
5
 * Menu for public group of actions
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
22
 * @category  Menu
23
 * @package   StatusNet
24
 * @author    Evan Prodromou <evan@status.net>
25
 * @copyright 2008 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
 * Menu for public group of actions
34 35
 *
 * @category Output
36
 * @package  StatusNet
37 38
 * @author   Evan Prodromou <evan@status.net>
 * @author   Sarven Capadisli <csarven@status.net>
39
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
40
 * @link     http://status.net/
41
 *
42
 * @see      Widget
43
 */
44
class PublicGroupNav extends Menu
45
{
46 47 48

    var $actionName = null;

49 50 51 52 53
    /**
     * Show the menu
     *
     * @return void
     */
54 55
    function show()
    {
56
        $this->actionName = $this->action->trimmed('action');
57

sarven's avatar
sarven committed
58
        $this->action->elementStart('ul', array('class' => 'nav'));
59

60
        if (Event::handle('StartPublicGroupNav', array($this))) {
61 62 63 64 65 66
            if (!common_config('singleuser', 'enabled')) {
                // TRANS: Menu item in search group navigation panel.
                $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
                                     // TRANS: Menu item title in search group navigation panel.
                                     _('Public timeline'), $this->actionName == 'public', 'nav_timeline_public');
            }
67 68
            if (!common_config('public', 'localonly') || $this->action->getScoped() instanceof Profile) {
                // Allow network wide view if you're logged in
69 70 71 72 73
                // TRANS: Menu item in search group navigation panel.
                $this->out->menuItem(common_local_url('networkpublic'), _m('MENU','Network'),
                                     // TRANS: Menu item title in search group navigation panel.
                                     _('Network public timeline'), $this->actionName == 'networkpublic', 'nav_timeline_networkpublic');
            }
74

Siebrand Mazeland's avatar
Siebrand Mazeland committed
75 76 77
            // TRANS: Menu item in search group navigation panel.
            $this->out->menuItem(common_local_url('groups'), _m('MENU','Groups'),
                // TRANS: Menu item title in search group navigation panel.
78
                _('User groups'), $this->actionName == 'groups', 'nav_groups');
79

80 81 82 83 84 85
            if (!common_config('performance', 'high')) {
                // TRANS: Menu item in search group navigation panel.
                $this->out->menuItem(common_local_url('publictagcloud'), _m('MENU','Recent tags'),
                                     // TRANS: Menu item title in search group navigation panel.
                                     _('Recent tags'), $this->actionName == 'publictagcloud', 'nav_recent-tags');
            }
86

87
            if (count(common_config('nickname', 'featured')) > 0) {
Siebrand Mazeland's avatar
Siebrand Mazeland committed
88 89 90
                // TRANS: Menu item in search group navigation panel.
                $this->out->menuItem(common_local_url('featured'), _m('MENU','Featured'),
                    // TRANS: Menu item title in search group navigation panel.
91
                    _('Featured users'), $this->actionName == 'featured', 'nav_featured');
92
            }
93

94 95
            Event::handle('EndPublicGroupNav', array($this));
        }
96
        $this->action->elementEnd('ul');
97 98
    }
}