We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

searchgroupnav.php 2.99 KB
Newer Older
Robin Millette's avatar
Robin Millette committed
1 2
<?php
/**
3
 * StatusNet, the distributed open-source microblogging tool
Robin Millette's avatar
Robin Millette committed
4
 *
5
 * Menu for search group of actions
Robin Millette's avatar
Robin Millette committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * 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/>.
 *
 * @category  Menu
23
 * @package   StatusNet
24
 * @author    Evan Prodromou <evan@status.net>
25
 * @copyright 2008-2011 StatusNet, Inc.
Robin Millette's avatar
Robin Millette committed
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/
Robin Millette's avatar
Robin Millette committed
28 29
 */

30
if (!defined('STATUSNET') && !defined('LACONICA')) {
Robin Millette's avatar
Robin Millette committed
31 32 33 34 35 36
    exit(1);
}

/**
 * Menu for public group of actions
 *
37
 * @category Menu
38
 * @package  StatusNet
39
 * @author   Evan Prodromou <evan@status.net>
Robin Millette's avatar
Robin Millette committed
40
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
41
 * @link     http://status.net/
Robin Millette's avatar
Robin Millette committed
42 43 44
 *
 * @see      Widget
 */
45
class SearchGroupNav extends Menu
Robin Millette's avatar
Robin Millette committed
46
{
47
    var $q = null;
Robin Millette's avatar
Robin Millette committed
48 49 50 51 52 53

    /**
     * Construction
     *
     * @param Action $action current action, used for output
     */
54
    function __construct($action=null, $q = null)
Robin Millette's avatar
Robin Millette committed
55 56
    {
        parent::__construct($action);
57
        $this->q = $q;
Robin Millette's avatar
Robin Millette committed
58 59 60 61 62 63 64 65 66 67 68
    }

    /**
     * Show the menu
     *
     * @return void
     */
    function show()
    {
        $action_name = $this->action->trimmed('action');
        $this->action->elementStart('ul', array('class' => 'nav'));
69 70 71 72
        $args = array();
        if ($this->q) {
            $args['q'] = $this->q;
        }
Siebrand Mazeland's avatar
Siebrand Mazeland committed
73 74 75
        // TRANS: Menu item in search group navigation panel.
        $this->out->menuItem(common_local_url('peoplesearch', $args), _m('MENU','People'),
            // TRANS: Menu item title in search group navigation panel.
Robin Millette's avatar
Robin Millette committed
76
            _('Find people on this site'), $action_name == 'peoplesearch', 'nav_search_people');
Siebrand Mazeland's avatar
Siebrand Mazeland committed
77 78 79
        // TRANS: Menu item in search group navigation panel.
        $this->out->menuItem(common_local_url('noticesearch', $args), _m('MENU','Notices'),
            // TRANS: Menu item title in search group navigation panel.
Robin Millette's avatar
Robin Millette committed
80
            _('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice');
Siebrand Mazeland's avatar
Siebrand Mazeland committed
81 82 83
        // TRANS: Menu item in search group navigation panel.
        $this->out->menuItem(common_local_url('groupsearch', $args), _m('MENU','Groups'),
            // TRANS: Menu item title in search group navigation panel.
sarven's avatar
sarven committed
84
            _('Find groups on this site'), $action_name == 'groupsearch', 'nav_search_group');
Robin Millette's avatar
Robin Millette committed
85 86 87
        $this->action->elementEnd('ul');
    }
}