);
}
- function showLocalNav()
- {
- $nav = new PersonalGroupNav($this);
- $nav->show();
- }
-
function showEmptyListMessage()
{
// TRANS: Empty list message. %s is a user nickname.
_('A list of the users blocked from joining this group.'));
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
$this->showPage();
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
$this->elementEnd('div');
}
- /**
- * Local navigation
- *
- * This page is part of the public group, so show that.
- *
- * @return void
- */
- function showLocalNav()
- {
- $nav = new PublicGroupNav($this);
- $nav->show();
- }
-
/**
* Content area
*
$this->elementEnd('div');
}
- function showLocalNav()
- {
- $nav = new PublicGroupNav($this);
- $nav->show();
- }
-
function getInstructions()
{
// TRANS: Description on page displaying featured users.
*
* @return nothing
*/
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
}
+ /**
+ * Override to show default nav stuff
+ *
+ * @return nothing
+ */
+ function showLocalNav()
+ {
+ Action::showLocalNav();
+ }
+
/**
* Get the design we want to edit
*
$this->autofocus('avatarfile');
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
_('A list of the users in this group.'));
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
$this->showPage();
}
- function showLocalNav()
- {
- $nav = new PublicGroupNav($this);
- $nav->show();
- }
-
function showPageNotice()
{
$notice =
mail_send($recipients, $headers, $body);
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new SubGroupNav($this, common_current_user());
$nav->show();
_('Public Stream Feed (Atom)')));
}
- /**
- * Show tabset for this page
- *
- * Uses the PublicGroupNav widget
- *
- * @return void
- * @see PublicGroupNav
- */
-
- function showLocalNav()
- {
- $nav = new PublicGroupNav($this);
- $nav->show();
- }
-
function showEmptyList()
{
$message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
$this->elementEnd('div');
}
- function showLocalNav()
- {
- $nav = new PublicGroupNav($this);
- $nav->show();
- }
-
function handle($args)
{
parent::handle($args);
$this->user->nickname)));
}
- /**
- * show the personal group nav
- *
- * @return void
- */
-
- function showLocalNav()
- {
- $nav = new PersonalGroupNav($this);
- $nav->show();
- }
-
/**
* Show the content
*
$this->user->nickname)));
}
- /**
- * show the personal group nav
- *
- * @return void
- */
- function showLocalNav()
- {
- $nav = new PersonalGroupNav($this);
- $nav->show();
- }
-
function showEmptyListMessage()
{
if (common_logged_in()) {
*
* @return void
*/
- function showLocalNav()
+ function showObjectNav()
{
$nav = new GroupNav($this, $this->group);
$nav->show();
$this->showNotices();
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new SubGroupNav($this, $this->user);
$nav->show();
$this->showPage();
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new SubGroupNav($this, $this->user);
$nav->show();
Event::handle('EndShowSiteNotice', array($this));
}
- if (common_logged_in()) {
- if (Event::handle('StartShowNoticeForm', array($this))) {
- $this->showNoticeForm();
- Event::handle('EndShowNoticeForm', array($this));
- }
- } else {
- $this->showAnonymousMessage();
- }
+
$this->elementEnd('div');
}
*/
function showPrimaryNav()
{
- $user = common_current_user();
- $this->elementStart('ul', array('class' => 'nav',
- 'id' => 'site_nav_global_primary'));
- if (Event::handle('StartPrimaryNav', array($this))) {
- if (!empty($user)) {
- $this->menuItem(common_local_url('all',
- array('nickname' => $user->nickname)),
- _m('Home'),
- _m('Friends timeline'),
- false,
- 'nav_home');
- $this->menuItem(common_local_url('showstream',
- array('nickname' => $user->nickname)),
- _m('Profile'),
- _m('Your profile'),
- false,
- 'nav_profile');
- $this->menuItem(common_local_url('public'),
- _m('Public'),
- _m('Everyone on this site'),
- false,
- 'nav_public');
- $this->menuItem(common_local_url('profilesettings'),
- _m('Settings'),
- _m('Change your personal settings'),
- false,
- 'nav_account');
- if ($user->hasRight(Right::CONFIGURESITE)) {
- $this->menuItem(common_local_url('siteadminpanel'),
- _m('Admin'),
- _m('Site configuration'),
- false,
- 'nav_admin');
- }
- $this->menuItem(common_local_url('logout'),
- _m('Logout'),
- _m('Logout from the site'),
- false,
- 'nav_logout');
- } else {
- $this->menuItem(common_local_url('public'),
- _m('Public'),
- _m('Everyone on this site'),
- false,
- 'nav_public');
- $this->menuItem(common_local_url('login'),
- _m('Login'),
- _m('Login to the site'),
- false,
- 'nav_login');
- }
-
- if (!empty($user) || !common_config('site', 'private')) {
- $this->menuItem(common_local_url('noticesearch'),
- _m('Search'),
- _m('Search the site'),
- false,
- 'nav_search');
- }
-
- Event::handle('EndPrimaryNav', array($this));
- }
- $this->elementEnd('ul');
+ $this->elementStart('div', array('id' => 'site_nav_global_primary'));
+ $pn = new PrimaryNav($this);
+ $pn->show();
+ $this->elementEnd('div');
}
/**
$this->showContentBlock();
Event::handle('EndShowContentBlock', array($this));
}
+ if (Event::handle('StartShowObjectNavBlock', array($this))) {
+ $this->showObjectNavBlock();
+ Event::handle('EndShowObjectNavBlock', array($this));
+ }
if (Event::handle('StartShowAside', array($this))) {
$this->showAside();
Event::handle('EndShowAside', array($this));
*/
function showLocalNav()
{
- // does nothing by default
+ $nav = new DefaultLocalNav($this);
+ $nav->show();
+ }
+
+ /**
+ * Show menu for an object (group, profile)
+ *
+ * @return nothing
+ */
+ function showObjectNavBlock()
+ {
+ // Need to have this ID for CSS; I'm too lazy to add it to
+ // all menus
+ $this->elementStart('div', array('id' => 'site_nav_object'));
+ $this->showObjectNav();
+ $this->elementEnd('div');
+ }
+
+ /**
+ * Show object navigation.
+ *
+ * If there are things to do with this object, show it here.
+ *
+ * @return nothing
+ */
+ function showObjectNav()
+ {
+ /* Nothing here. */
}
/**
function showContentBlock()
{
$this->elementStart('div', array('id' => 'content'));
+ if (common_logged_in()) {
+ if (Event::handle('StartShowNoticeForm', array($this))) {
+ $this->showNoticeForm();
+ Event::handle('EndShowNoticeForm', array($this));
+ }
+ }
if (Event::handle('StartShowPageTitle', array($this))) {
$this->showPageTitle();
Event::handle('EndShowPageTitle', array($this));
*/
function showSecondaryNav()
{
- $this->elementStart('ul', array('class' => 'nav',
- 'id' => 'site_nav_global_secondary'));
- if (Event::handle('StartSecondaryNav', array($this))) {
- $this->menuItem(common_local_url('doc', array('title' => 'help')),
- // TRANS: Secondary navigation menu option leading to help on StatusNet.
- _('Help'));
- $this->menuItem(common_local_url('doc', array('title' => 'about')),
- // TRANS: Secondary navigation menu option leading to text about StatusNet site.
- _('About'));
- $this->menuItem(common_local_url('doc', array('title' => 'faq')),
- // TRANS: Secondary navigation menu option leading to Frequently Asked Questions.
- _('FAQ'));
- $bb = common_config('site', 'broughtby');
- if (!empty($bb)) {
- $this->menuItem(common_local_url('doc', array('title' => 'tos')),
- // TRANS: Secondary navigation menu option leading to Terms of Service.
- _('TOS'));
- }
- $this->menuItem(common_local_url('doc', array('title' => 'privacy')),
- // TRANS: Secondary navigation menu option leading to privacy policy.
- _('Privacy'));
- $this->menuItem(common_local_url('doc', array('title' => 'source')),
- // TRANS: Secondary navigation menu option. Leads to information about StatusNet and its license.
- _('Source'));
- $this->menuItem(common_local_url('version'),
- // TRANS: Secondary navigation menu option leading to version information on the StatusNet site.
- _('Version'));
- $this->menuItem(common_local_url('doc', array('title' => 'contact')),
- // TRANS: Secondary navigation menu option leading to e-mail contact information on the
- // TRANS: StatusNet site, where to report bugs, ...
- _('Contact'));
- $this->menuItem(common_local_url('doc', array('title' => 'badge')),
- // TRANS: Secondary navigation menu option. Leads to information about embedding a timeline widget.
- _('Badge'));
- Event::handle('EndSecondaryNav', array($this));
- }
- $this->elementEnd('ul');
+ $sn = new SecondaryNav($this);
+ $sn->show();
}
/**
return $isOK;
}
}
-
-/**
- * Menu for public group of actions
- *
- * @category Output
- * @package StatusNet
- * @author Evan Prodromou <evan@status.net>
- * @author Sarven Capadisli <csarven@status.net>
- * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://status.net/
- *
- * @see Widget
- */
-class AdminPanelNav extends Widget
-{
- var $action = null;
-
- /**
- * Construction
- *
- * @param Action $action current action, used for output
- */
- function __construct($action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
-
- /**
- * Show the menu
- *
- * @return void
- */
- function show()
- {
- $action_name = $this->action->trimmed('action');
-
- $this->action->elementStart('ul', array('class' => 'nav'));
-
- if (Event::handle('StartAdminPanelNav', array($this))) {
-
- if (AdminPanelAction::canAdmin('site')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Basic site configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
- $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('design')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Design configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
- $menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('user')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('User configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('useradminpanel'), _('User'),
- $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('access')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Access configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
- $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('paths')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Paths configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
- $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('sessions')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Sessions configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
- $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('sitenotice')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Edit site notice');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
- $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('snapshot')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Snapshots configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
- $menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('license')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Set site license');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
- $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
- }
-
- if (AdminPanelAction::canAdmin('plugins')) {
- // TRANS: Menu item title/tooltip
- $menu_title = _('Plugins configuration');
- // TRANS: Menu item for site administration
- $this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
- $menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
- }
-
- Event::handle('EndAdminPanelNav', array($this));
- }
- $this->action->elementEnd('ul');
- }
-}
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Menu for admin panels
+ *
+ * PHP version 5
+ *
+ * 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
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Menu for admin panels
+ *
+ * @category Output
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Sarven Capadisli <csarven@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class AdminPanelNav extends Menu
+{
+ /**
+ * Show the menu
+ *
+ * @return void
+ */
+ function show()
+ {
+ $action_name = $this->action->trimmed('action');
+
+ $this->action->elementStart('ul', array('class' => 'nav'));
+
+ if (Event::handle('StartAdminPanelNav', array($this))) {
+
+ if (AdminPanelAction::canAdmin('site')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Basic site configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
+ $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('design')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Design configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
+ $menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('user')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('User configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('useradminpanel'), _('User'),
+ $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('access')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Access configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
+ $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('paths')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Paths configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
+ $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('sessions')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Sessions configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
+ $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('sitenotice')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Edit site notice');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
+ $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('snapshot')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Snapshots configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
+ $menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('license')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Set site license');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
+ $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
+ }
+
+ if (AdminPanelAction::canAdmin('plugins')) {
+ // TRANS: Menu item title/tooltip
+ $menu_title = _('Plugins configuration');
+ // TRANS: Menu item for site administration
+ $this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
+ $menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
+ }
+
+ Event::handle('EndAdminPanelNav', array($this));
+ }
+ $this->action->elementEnd('ul');
+ }
+}
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Default local nav
+ *
+ * PHP version 5
+ *
+ * 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
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Default menu
+ *
+ * @category Menu
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class DefaultLocalNav extends Menu
+{
+ function show()
+ {
+ $this->action->elementStart('ul', array('id' => 'nav_local_default'));
+
+ $user = common_current_user();
+
+ if (!empty($user)) {
+ $pn = new PersonalGroupNav($this->action);
+ $this->submenu(_m('Home'), $pn);
+ }
+
+ $bn = new PublicGroupNav($this->action);
+ $this->submenu(_('Public'), $bn);
+
+ $this->action->elementEnd('ul');
+ }
+}
$this->showPage();
}
- function showLocalNav()
+ function showObjectNav()
{
$nav = new SubGroupNav($this, $this->user);
$nav->show();
* @see HTMLOutputter
*/
-class GroupNav extends Widget
+class GroupNav extends Menu
{
- var $action = null;
var $group = null;
/**
function __construct($action=null, $group=null)
{
parent::__construct($action);
- $this->action = $action;
$this->group = $group;
}
*
* @see Widget
*/
-class LoginGroupNav extends Widget
+class LoginGroupNav extends Menu
{
- var $action = null;
-
- /**
- * Construction
- *
- * @param Action $action current action, used for output
- */
- function __construct($action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
-
/**
* Show the menu
*
{
return true;
}
+
+ function showObjectNav()
+ {
+ $mm = new MailboxMenu($this);
+ $mm->show();
+ }
}
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Private mailboxes menu
+ *
+ * PHP version 5
+ *
+ * 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 Cache
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Menu of existing mailboxes
+ *
+ * @category General
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class MailboxMenu extends Menu
+{
+ function show()
+ {
+ $cur = common_current_user();
+ $nickname = $cur->nickname;
+
+ $this->out->elementStart('ul', array('class' => 'nav'));
+
+ $this->item('inbox',
+ array('nickname' => $nickname),
+ _('Inbox'),
+ _('Your incoming messages'));
+
+ $this->item('outbox',
+ array('nickname' => $nickname),
+ _('Outbox'),
+ _('Your sent messages'));
+
+ $this->out->elementEnd('ul');
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Menu widget
+ *
+ * PHP version 5
+ *
+ * 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 Widget
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Superclass for menus
+ *
+ * @category General
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class Menu extends Widget
+{
+ var $action = null;
+ var $actionName = null;
+ /**
+ * Construction
+ *
+ * @param Action $action current action, used for output
+ */
+ function __construct($action=null)
+ {
+ parent::__construct($action);
+
+ $this->action = $action;
+ $this->actionName = $action->trimmed('action');
+ }
+
+ function item($actionName, $args, $label, $description, $id=null)
+ {
+ if (empty($id)) {
+ $id = $this->menuItemID($actionName);
+ }
+
+ $url = common_local_url($actionName, $args);
+
+ $this->out->menuItem($url,
+ $label,
+ $description,
+ $actionName == $this->actionName,
+ $id);
+ }
+
+ function menuItemID($actionName)
+ {
+ return sprintf('nav_%s', $actionName);
+ }
+
+ function submenu($label, $menu)
+ {
+ $this->action->elementStart('li');
+ $this->action->element('h3', null, $label);
+ $menu->show();
+ $this->action->elementEnd('li');
+ }
+}
/**
* StatusNet, the distributed open-source microblogging tool
*
- * Base class for all actions (~views)
+ * Menu for personal group of actions
*
* PHP version 5
*
* 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 Action
+ * @category Menu
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @author Sarven Capadisli <csarven@status.net>
- * @copyright 2008 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
exit(1);
}
-require_once INSTALLDIR.'/lib/widget.php';
-
/**
- * Base class for all actions
- *
- * This is the base class for all actions in the package. An action is
- * more or less a "view" in an MVC framework.
- *
- * Actions are responsible for extracting and validating parameters; using
- * model classes to read and write to the database; and doing ouput.
+ * Menu for personal group of actions
*
- * @category Output
+ * @category Menu
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @author Sarven Capadisli <csarven@status.net>
+ * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
- *
- * @see HTMLOutputter
*/
-class PersonalGroupNav extends Widget
-{
- var $action = null;
-
- /**
- * Construction
- *
- * @param Action $action current action, used for output
- */
- function __construct($action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
+class PersonalGroupNav extends Menu
+{
/**
* Show the menu
*
*/
function show()
{
- $user = null;
-
- // FIXME: we should probably pass this in
-
- $action = $this->action->trimmed('action');
- $nickname = $this->action->trimmed('nickname');
+ $user = common_current_user();
- if ($nickname) {
- $user = User::staticGet('nickname', $nickname);
- $user_profile = $user->getProfile();
- $name = $user_profile->getBestName();
- } else {
- // @fixme can this happen? is this valid?
- $user_profile = false;
- $name = $nickname;
+ if (empty($user)) {
+ throw new ServerException('Do not show personal group nav with no current user.');
}
+ $user_profile = $user->getProfile();
+ $nickname = $user->nickname;
+ $name = $user_profile->getBestName();
+
$this->out->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartPersonalGroupNav', array($this))) {
_('Home'),
sprintf(_('%s and friends'), $name),
$action == 'all', 'nav_timeline_personal');
+ $this->out->menuItem(common_local_url('showstream', array('nickname' =>
+ $nickname)),
+ _('Profile'),
+ _('Your profile'),
+ $action == 'showstream',
+ 'nav_profile');
$this->out->menuItem(common_local_url('replies', array('nickname' =>
$nickname)),
_('Replies'),
$this->out->menuItem(common_local_url('inbox', array('nickname' =>
$nickname)),
- _('Inbox'),
+ _('Messages'),
_('Your incoming messages'),
$action == 'inbox');
- $this->out->menuItem(common_local_url('outbox', array('nickname' =>
- $nickname)),
- _('Outbox'),
- _('Your sent messages'),
- $action == 'outbox');
}
+
Event::handle('EndPersonalGroupNav', array($this));
}
$this->out->elementEnd('ul');
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Primary nav, show on all pages
+ *
+ * PHP version 5
+ *
+ * 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
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Primary, top-level menu
+ *
+ * @category General
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class PrimaryNav extends Menu
+{
+ function show()
+ {
+ $user = common_current_user();
+ $this->action->elementStart('ul', array('class' => 'nav'));
+ if (Event::handle('StartPrimaryNav', array($this->action))) {
+ if (!empty($user)) {
+ $this->action->menuItem(common_local_url('profilesettings'),
+ _m('Settings'),
+ _m('Change your personal settings'),
+ false,
+ 'nav_account');
+ if ($user->hasRight(Right::CONFIGURESITE)) {
+ $this->action->menuItem(common_local_url('siteadminpanel'),
+ _m('Admin'),
+ _m('Site configuration'),
+ false,
+ 'nav_admin');
+ }
+ $this->action->menuItem(common_local_url('logout'),
+ _m('Logout'),
+ _m('Logout from the site'),
+ false,
+ 'nav_logout');
+ } else {
+ $this->action->menuItem(common_local_url('login'),
+ _m('Login'),
+ _m('Login to the site'),
+ false,
+ 'nav_login');
+ }
+
+ if (!empty($user) || !common_config('site', 'private')) {
+ $this->action->menuItem(common_local_url('noticesearch'),
+ _m('Search'),
+ _m('Search the site'),
+ false,
+ 'nav_search');
+ }
+
+ Event::handle('EndPrimaryNav', array($this->action));
+ }
+
+ $this->action->elementEnd('ul');
+ }
+}
* @see Widget
*/
-class PublicGroupNav extends Widget
+class PublicGroupNav extends Menu
{
- var $action = null;
-
- /**
- * Construction
- *
- * @param Action $action current action, used for output
- */
-
- function __construct($action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
-
/**
* Show the menu
*
* @return void
* @see SearchGroupNav
*/
- function showLocalNav()
+ function showObjectNav()
{
$nav = new SearchGroupNav($this, $this->trimmed('q'));
$nav->show();
/**
* StatusNet, the distributed open-source microblogging tool
*
- * Menu for search actions
+ * Menu for search group of actions
*
* PHP version 5
*
* @category Menu
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
- * @copyright 2008 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
exit(1);
}
-require_once INSTALLDIR.'/lib/widget.php';
-
/**
* Menu for public group of actions
*
- * @category Output
+ * @category Menu
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @see Widget
*/
-class SearchGroupNav extends Widget
+class SearchGroupNav extends Menu
{
- var $action = null;
var $q = null;
/**
function __construct($action=null, $q = null)
{
parent::__construct($action);
- $this->action = $action;
$this->q = $q;
}
--- /dev/null
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Secondary menu, shown at foot of all pages
+ *
+ * PHP version 5
+ *
+ * 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 Cache
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ // This check helps protect against security problems;
+ // your code file can't be executed directly from the web.
+ exit(1);
+}
+
+/**
+ * Secondary menu, shown at the bottom of all pages
+ *
+ * @category General
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link http://status.net/
+ */
+
+class SecondaryNav extends Menu
+{
+ function show()
+ {
+ $this->out->elementStart('ul', array('class' => 'nav',
+ 'id' => 'site_nav_global_secondary'));
+ if (Event::handle('StartSecondaryNav', array($this->action))) {
+ $this->out->menuItem(common_local_url('doc', array('title' => 'help')),
+ // TRANS: Secondary navigation menu option leading to help on StatusNet.
+ _('Help'));
+ $this->out->menuItem(common_local_url('doc', array('title' => 'about')),
+ // TRANS: Secondary navigation menu option leading to text about StatusNet site.
+ _('About'));
+ $this->out->menuItem(common_local_url('doc', array('title' => 'faq')),
+ // TRANS: Secondary navigation menu option leading to Frequently Asked Questions.
+ _('FAQ'));
+ $bb = common_config('site', 'broughtby');
+ if (!empty($bb)) {
+ $this->out->menuItem(common_local_url('doc', array('title' => 'tos')),
+ // TRANS: Secondary navigation menu option leading to Terms of Service.
+ _('TOS'));
+ }
+ $this->out->menuItem(common_local_url('doc', array('title' => 'privacy')),
+ // TRANS: Secondary navigation menu option leading to privacy policy.
+ _('Privacy'));
+ $this->out->menuItem(common_local_url('doc', array('title' => 'source')),
+ // TRANS: Secondary navigation menu option. Leads to information about StatusNet and its license.
+ _('Source'));
+ $this->out->menuItem(common_local_url('version'),
+ // TRANS: Secondary navigation menu option leading to version information on the StatusNet site.
+ _('Version'));
+ $this->out->menuItem(common_local_url('doc', array('title' => 'contact')),
+ // TRANS: Secondary navigation menu option leading to e-mail contact information on the
+ // TRANS: StatusNet site, where to report bugs, ...
+ _('Contact'));
+ $this->out->menuItem(common_local_url('doc', array('title' => 'badge')),
+ // TRANS: Secondary navigation menu option. Leads to information about embedding a timeline widget.
+ _('Badge'));
+ Event::handle('EndSecondaryNav', array($this->action));
+ }
+ $this->out->elementEnd('ul');
+ }
+}
\ No newline at end of file
$menu = new SettingsNav($this);
$menu->show();
}
+
+ /**
+ * Show notice form.
+ *
+ * @return nothing
+ */
+
+ function showNoticeForm()
+ {
+ return;
+ }
}
<?php
/**
* StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2010, StatusNet, Inc.
+ * Copyright (C) 2010,2011, StatusNet, Inc.
*
* Settings menu
*
* @category Widget
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
- * @copyright 2010 StatusNet, Inc.
+ * @copyright 2010,2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
* @see HTMLOutputter
*/
-class SettingsNav extends Widget
+class SettingsNav extends Menu
{
- var $action = null;
-
- /**
- * Construction
- *
- * @param Action $action current action, used for output
- */
- function __construct($action=null)
- {
- parent::__construct($action);
- $this->action = $action;
- }
-
/**
* Show the menu
*
* @category Subs
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @link http://status.net/
*/
-class SubGroupNav extends Widget
+class SubGroupNav extends Menu
{
- var $action = null;
var $user = null;
/**
function __construct($action=null, $user=null)
{
parent::__construct($action);
- $this->action = $action;
$this->user = $user;
}
function showAvatar()
{
+ $this->out->elementStart('div', 'ur_face');
+
if (Event::handle('StartProfilePageAvatar', array($this->out, $this->profile))) {
$avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
Event::handle('EndProfilePageAvatar',
array($this->out, $this->profile));
}
+
+ $this->out->elementEnd('div');
}
function showNickname()