+ /**
+ * If we're in OpenID-only mode, hide all the main menu except OpenID login.
+ *
+ * @param Action $action Action being run
+ *
+ * @return boolean hook return
+ */
+
+ function onStartPrimaryNav($action)
+ {
+ if (common_config('site', 'openidonly') && !common_logged_in()) {
+ // TRANS: Tooltip for main menu option "Login"
+ $tooltip = _m('TOOLTIP', 'Login to the site');
+ $action->menuItem(common_local_url('openidlogin'),
+ // TRANS: Main menu option when not logged in to log in
+ _m('MENU', 'Login'),
+ $tooltip,
+ false,
+ 'nav_login');
+ // TRANS: Tooltip for main menu option "Help"
+ $tooltip = _m('TOOLTIP', 'Help me!');
+ $action->menuItem(common_local_url('doc', array('title' => 'help')),
+ // TRANS: Main menu option for help on the StatusNet site
+ _m('MENU', 'Help'),
+ $tooltip,
+ false,
+ 'nav_help');
+ if (!common_config('site', 'private')) {
+ // TRANS: Tooltip for main menu option "Search"
+ $tooltip = _m('TOOLTIP', 'Search for people or text');
+ $action->menuItem(common_local_url('peoplesearch'),
+ // TRANS: Main menu option when logged in or when the StatusNet instance is not private
+ _m('MENU', 'Search'), $tooltip, false, 'nav_search');
+ }
+ Event::handle('EndPrimaryNav', array($action));
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Menu for login
+ *
+ * If we're in openidOnly mode, we disable the menu for all other login.
+ *
+ * @param Action &$action Action being executed
+ *
+ * @return boolean hook return
+ */
+
+ function onStartLoginGroupNav(&$action)
+ {
+ if (common_config('site', 'openidonly')) {
+ $this->showOpenIDLoginTab($action);
+ // Even though we replace this code, we
+ // DON'T run the End* hook, to keep others from
+ // adding tabs. Not nice, but.
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Menu item for login
+ *
+ * @param Action &$action Action being executed
+ *
+ * @return boolean hook return
+ */
+