當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MenuAdmin::addPlatformItem方法代碼示例

本文整理匯總了PHP中Piwik\Menu\MenuAdmin::addPlatformItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP MenuAdmin::addPlatformItem方法的具體用法?PHP MenuAdmin::addPlatformItem怎麽用?PHP MenuAdmin::addPlatformItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\Menu\MenuAdmin的用法示例。


在下文中一共展示了MenuAdmin::addPlatformItem方法的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));
         }
     }
     if (!$isAnonymous) {
         $menu->addPlatformItem(null, "", $order = 7);
     }
     if ($hasSuperUserAcess) {
         $menu->addPlatformItem(Piwik::translate('General_Plugins') . $pluginsUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'plugins', 'activated' => ''), $order = 1);
         $menu->addPlatformItem(Piwik::translate('CorePluginsAdmin_Themes') . $themesUpdateMessage, array('module' => 'CorePluginsAdmin', 'action' => 'themes', 'activated' => ''), $order = 3);
     }
     if ($this->isAllowedToSeeMarketPlace()) {
         $menu->addPlatformItem('CorePluginsAdmin_Marketplace', array('module' => 'CorePluginsAdmin', 'action' => 'extend', 'activated' => ''), $order = 5);
     }
 }
開發者ID:emersonmatsumoto,項目名稱:piwik,代碼行數:29,代碼來源:Menu.php

示例2: configureAdminMenu

 public function configureAdminMenu(MenuAdmin $menu)
 {
     $menu->addPlatformItem('General_API', $this->urlForAction('listAllAPI', array('segment' => false)), 7, Piwik::translate('API_TopLinkTooltip'));
     if (Piwik::isUserIsAnonymous()) {
         $menu->addPlatformItem('API_Glossary', $this->urlForAction('glossary', array('segment' => false)), 50);
     }
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:7,代碼來源:Menu.php

示例3: configureAdminMenu

 public function configureAdminMenu(MenuAdmin $menu)
 {
     $hasSuperUserAcess = Piwik::hasUserSuperUserAccess();
     $isAnonymous = Piwik::isUserIsAnonymous();
     $isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();
     $pluginsUpdateMessage = '';
     if ($hasSuperUserAcess && $isMarketplaceEnabled) {
         $marketplace = new Marketplace();
         $pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = false);
         $themesHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly = true);
         if (!empty($pluginsHavingUpdate)) {
             $pluginsUpdateMessage = sprintf(' (%d)', count($pluginsHavingUpdate) + count($themesHavingUpdate));
         }
     }
     if (!$isAnonymous) {
         $menu->addPlatformItem(null, "", $order = 7);
     }
     if ($hasSuperUserAcess) {
         $menu->addManageItem(Piwik::translate('General_Plugins') . $pluginsUpdateMessage, $this->urlForAction('plugins', array('activated' => '')), $order = 4);
     }
     if (Piwik::hasUserSuperUserAccess() && CorePluginsAdmin::isMarketplaceEnabled()) {
         $menu->addManageItem('CorePluginsAdmin_Marketplace', $this->urlForAction('browsePlugins', array('activated' => '')), $order = 12);
     }
 }
開發者ID:CaptainSharf,項目名稱:SSAD_Project,代碼行數:24,代碼來源:Menu.php


注:本文中的Piwik\Menu\MenuAdmin::addPlatformItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。