本文整理汇总了PHP中Action::menuItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::menuItem方法的具体用法?PHP Action::menuItem怎么用?PHP Action::menuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::menuItem方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onEndAccountSettingsNav
/**
* 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: onStartPrimaryNav
/**
* 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: onEndAccountSettingsNav
/**
* 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;
}
示例4: showOpenIDLoginTab
/**
* 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');
}
示例5: onEndConnectSettingsNav
/**
* 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: onEndPrimaryNav
/**
* 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: onEndAccountSettingsNav
/**
* 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: onEndAccountSettingsNav
/**
* 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;
}
示例9: onEndAccountSettingsNav
/**
* 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;
}
示例10: onEndAccountSettingsNav
/**
* 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: onEndPersonalGroupNav
/**
* 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;
}