* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
-}
-
-require_once INSTALLDIR.'/lib/widget.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Menu for public group of actions
*/
class PublicGroupNav extends Menu
{
+
+ var $actionName = null;
+
/**
* Show the menu
*
*/
function show()
{
- $action_name = $this->action->trimmed('action');
+ $this->actionName = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPublicGroupNav', array($this))) {
- // 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'), $action_name == 'public', 'nav_timeline_public');
+ 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');
+ }
+ if (!common_config('public', 'localonly') || $this->action->getScoped() instanceof Profile) {
+ // Allow network wide view if you're logged in
+ // 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');
+ }
// 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.
- _('User groups'), $action_name == 'groups', 'nav_groups');
-
- // 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'), $action_name == 'publictagcloud', 'nav_recent-tags');
-
- $this->out->menuItem(common_local_url('publicpeopletagcloud'), _('People tags'),
- _('People tags'), in_array($action_name, array('publicpeopletagcloud',
- 'peopletag', 'selftag')), 'nav_people-tags');
+ _('User groups'), $this->actionName == 'groups', 'nav_groups');
if (count(common_config('nickname', 'featured')) > 0) {
// 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.
- _('Featured users'), $action_name == 'featured', 'nav_featured');
+ _('Featured users'), $this->actionName == 'featured', 'nav_featured');
}
- // TRANS: Menu item in search group navigation panel.
- $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
- // TRANS: Menu item title in search group navigation panel.
- _('Popular notices'), $action_name == 'favorited', 'nav_timeline_favorited');
-
Event::handle('EndPublicGroupNav', array($this));
}
$this->action->elementEnd('ul');