本文整理汇总了PHP中Piwik\Menu\MenuAdmin::add方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuAdmin::add方法的具体用法?PHP MenuAdmin::add怎么用?PHP MenuAdmin::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Menu\MenuAdmin
的用法示例。
在下文中一共展示了MenuAdmin::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$hasSuperUserAcess = Piwik::hasUserSuperUserAccess();
$isAnonymous = Piwik::isUserIsAnonymous();
$isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();
$pluginsUpdateMessage = '';
$themesUpdateMessage = '';
if ($hasSuperUserAcess && $isMarketplaceEnabled) {
$marketplace = new Marketplace();
$pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = false);
$themesHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = true);
if (!empty($pluginsHavingUpdate)) {
$pluginsUpdateMessage = sprintf(' (%d)', count($pluginsHavingUpdate));
}
if (!empty($themesHavingUpdate)) {
$themesUpdateMessage = sprintf(' (%d)', count($themesHavingUpdate));
}
}
$menu->add('CorePluginsAdmin_MenuPlatform', null, "", !$isAnonymous, $order = 7);
$menu->add('CorePluginsAdmin_MenuPlatform', Piwik::translate('General_Plugins') . $pluginsUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'plugins', 'activated' => ''), $hasSuperUserAcess, $order = 1);
$menu->add('CorePluginsAdmin_MenuPlatform', Piwik::translate('CorePluginsAdmin_Themes') . $themesUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'themes', 'activated' => ''), $hasSuperUserAcess, $order = 3);
if ($isMarketplaceEnabled) {
$menu->add('CorePluginsAdmin_MenuPlatform', 'CorePluginsAdmin_Marketplace', array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''), !$isAnonymous, $order = 5);
}
}
示例2: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUsers', array('module' => 'UsersManager', 'action' => 'index'), Piwik::isUserHasSomeAdminAccess(), $order = 2);
$menu->add('CoreAdminHome_MenuManage', 'UsersManager_MenuUserSettings', array('module' => 'UsersManager', 'action' => 'userSettings'), Piwik::isUserHasSomeViewAccess(), $order = 3);
}
示例3: configureAdminMenu
public function configureAdminMenu(MenuAdmin $menu)
{
$menu->add('CoreAdminHome_MenuDiagnostic', 'TasksTimetable_ScheduledTasks', array('module' => 'TasksTimetable', 'action' => 'index'), $showOnlyIf = Piwik::hasUserSuperUserAccess(), $order = 6);
}