/**
  * Menu item for personal subscriptions/groups area
  *
  * @param Action $action action being executed
  *
  * @return boolean hook return
  */
 function onEndAccountSettingsNav($action)
 {
     $action_name = $action->trimmed('action');
     common_debug("ACTION NAME = " . $action_name);
     $action->menuItem(common_local_url('mirrorsettings'), _m('MENU', 'Mirroring'), _m('Configure mirroring of posts from other feeds'), $action_name === 'mirrorsettings');
     return true;
 }
示例#2
0
 /**
  * Modify the default menu
  *
  * @param Action $action The current action handler. Use this to
  *                       do any output.
  *
  * @return boolean hook value; true means continue processing, false means stop.
  *
  * @see Action
  */
 function onStartPrimaryNav($action)
 {
     $user = common_current_user();
     if (!empty($user)) {
         $action->menuItem(common_local_url('all', array('nickname' => $user->nickname)), _m('Home'), _m('Friends timeline'), false, 'nav_home');
         $action->menuItem(common_local_url('showstream', array('nickname' => $user->nickname)), _m('Profile'), _m('Your profile'), false, 'nav_profile');
         $action->menuItem(common_local_url('public'), _m('Public'), _m('Everyone on this site'), false, 'nav_public');
         $action->menuItem(common_local_url('profilesettings'), _m('Settings'), _m('Change your personal settings'), false, 'nav_account');
         if ($user->hasRight(Right::CONFIGURESITE)) {
             $action->menuItem(common_local_url('siteadminpanel'), _m('Admin'), _m('Site configuration'), false, 'nav_admin');
         }
         $action->menuItem(common_local_url('logout'), _m('Logout'), _m('Logout from the site'), false, 'nav_logout');
     } else {
         $action->menuItem(common_local_url('public'), _m('Public'), _m('Everyone on this site'), false, 'nav_public');
         $action->menuItem(common_local_url('login'), _m('Login'), _m('Login to the site'), false, 'nav_login');
     }
     if (!empty($user) || !common_config('site', 'private')) {
         $action->menuItem(common_local_url('noticesearch'), _m('Search'), _m('Search the site'), false, 'nav_search');
     }
     Event::handle('EndPrimaryNav', array($action));
     return false;
 }
示例#3
0
 /**
  * Menu item for Qvitter
  *
  * @param Action $action action being executed
  *
  * @return boolean hook return
  */
 function onEndAccountSettingsNav($action)
 {
     $action_name = $action->trimmed('action');
     $action->menuItem(common_local_url('qvittersettings'), _m('MENU', 'Qvitter'), _m('Qvitter Settings'), $action_name === 'qvittersettings');
     return true;
 }
 /**
  * Show menu item for login
  *
  * @param Action $action Action being executed
  *
  * @return void
  */
 function showOpenIDLoginTab($action)
 {
     $action_name = $action->trimmed('action');
     $action->menuItem(common_local_url('openidlogin'), _m('OpenID'), _m('Login or register with OpenID'), $action_name === 'openidlogin');
 }
 /**
  * Add the Twitter Settings page to the Connect Settings menu
  *
  * @param Action $action The calling page
  *
  * @return boolean hook return
  */
 function onEndConnectSettingsNav($action)
 {
     if (self::hasKeys()) {
         $action_name = $action->trimmed('action');
         $action->menuItem(common_local_url('twittersettings'), _m('MENU', 'Twitter'), _m('Twitter integration options'), $action_name === 'twittersettings');
     }
     return true;
 }
示例#6
0
 /**
  * Modify the default menu to link to our custom action
  *
  * Using event handlers, it's possible to modify the default UI for pages
  * almost without limit. In this method, we add a menu item to the default
  * primary menu for the interface to link to our action.
  *
  * The Action class provides a rich set of events to hook, as well as output
  * methods.
  *
  * @param Action $action The current action handler. Use this to
  *                       do any output.
  *
  * @return boolean hook value; true means continue processing, false means stop.
  *
  * @see Action
  */
 function onEndPrimaryNav($action)
 {
     // common_local_url() gets the correct URL for the action name
     // we provide
     $action->menuItem(common_local_url('hello'), _m('Hello'), _m('A warm greeting'), false, 'nav_hello');
     return true;
 }
示例#7
0
 /**
  * Menu item for personal subscriptions/groups area
  *
  * @param Action $action action being executed
  *
  * @return boolean hook return
  */
 function onEndAccountSettingsNav($action)
 {
     $action_name = $action->trimmed('action');
     $action->menuItem(common_local_url('pollsettings'), _m('MENU', 'Polls'), _m('Configure poll behavior'), $action_name === 'pollsettings');
     return true;
 }
示例#8
0
 /**
  * Menu item for OpenID settings
  *
  * @param Action $action Action being executed
  *
  * @return boolean hook return
  */
 function onEndAccountSettingsNav($action)
 {
     $action_name = $action->trimmed('action');
     $action->menuItem(common_local_url('openidsettings'), _m('MENU', 'OpenID'), _m('Add or remove OpenIDs.'), $action_name === 'openidsettings');
     return true;
 }
 /**
  * Add the FetLife Settings page to the Account Settings menu
  *
  * @param Action $action The calling page
  * @return boolean hook return
  */
 function onEndAccountSettingsNav($action)
 {
     $action_name = $action->trimmed('action');
     $action->menuItem(common_local_url('fetlifesettings'), 'FetLife', 'FetLife integration options', 'fetlifesettings' === $action_name);
     return true;
 }
 /**
  * Menu item for ChooseTheme
  *
  * @param Action $action action being executed
  *
  * @return boolean hook return
  */
 function onEndAccountSettingsNav(Action $action)
 {
     $action_name = $action->getActionName();
     $action->menuItem(common_local_url('choosethemesettings'), _m('MENU', 'Theme'), _m('Choose Theme'), $action_name === 'themesettings');
     return true;
 }
示例#11
0
 /**
  * Modify the default menu to link to our custom action
  *
  * Using event handlers, it's possible to modify the default UI for pages
  * almost without limit. In this method, we add a menu item to the default
  * primary menu for the interface to link to our action.
  *
  * The Action class provides a rich set of events to hook, as well as output
  * methods.
  *
  * @param Action $action The current action handler. Use this to
  * do any output.
  *
  * @return boolean hook value; true means continue processing, false means stop.
  *
  * @see Action
  */
 function onEndPersonalGroupNav($action)
 {
     $this->user = common_current_user();
     if (!$this->user) {
         // TRANS: Client error displayed when trying to display bookmarks for a non-existing user.
         $this->clientError(_('No such user.'));
         return false;
     }
     $action->menuItem(common_local_url('bookmarks', array('nickname' => $this->user->nickname)), _m('Bookmarks'), _m('A list of your bookmarks'), false, 'nav_timeline_bookmarks');
     return true;
 }