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


PHP BASE_MenuItem::setPrefix方法代碼示例

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


在下文中一共展示了BASE_MenuItem::setPrefix方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMenu

 public function getMenu()
 {
     $language = OW::getLanguage();
     $menu = new BASE_CMP_ContentMenu();
     $menuItem = new BASE_MenuItem();
     $menuItem->setKey('all');
     $menuItem->setPrefix('questions');
     $menuItem->setLabel($language->text('questions', 'list_all_tab'));
     $menuItem->setOrder(1);
     $menuItem->setUrl(OW::getRouter()->urlForRoute('questions-all'));
     $menuItem->setIconClass('ow_ic_lens');
     $menu->addElement($menuItem);
     if (OW::getUser()->isAuthenticated()) {
         if (OW::getPluginManager()->isPluginActive('friends')) {
             $menuItem = new BASE_MenuItem();
             $menuItem->setKey('friends');
             $menuItem->setPrefix('questions');
             $menuItem->setLabel($language->text('questions', 'list_friends_tab'));
             $menuItem->setOrder(2);
             $menuItem->setUrl(OW::getRouter()->urlForRoute('questions-friends'));
             $menuItem->setIconClass('ow_ic_user');
             $menu->addElement($menuItem);
         }
         $menuItem = new BASE_MenuItem();
         $menuItem->setKey('my');
         $menuItem->setPrefix('questions');
         $menuItem->setLabel($language->text('questions', 'list_my_tab'));
         $menuItem->setOrder(3);
         $menuItem->setUrl(OW::getRouter()->urlForRoute('questions-my'));
         $menuItem->setIconClass('ow_ic_user');
         $menu->addElement($menuItem);
     }
     return $menu;
 }
開發者ID:jorgemunoz8807,項目名稱:havanabook,代碼行數:34,代碼來源:feed_menu.php

示例2: collectMailboxMenu

 public function collectMailboxMenu(BASE_CLASS_EventCollector $event)
 {
     if (!OW::getUser()->isAuthorized('mailbox', 'send_message')) {
         return;
     }
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('mcompose', 'compose_btn'));
     $item->setIconClass('ow_ic_new');
     $item->setPrefix('mcompose');
     $item->setUrl(OW::getRouter()->urlForRoute("mcompose-index"));
     $item->setKey('compose');
     $item->setOrder(3);
     $event->add($item);
     $staticUrl = OW::getPluginManager()->getPlugin('mcompose')->getStaticUrl();
     OW::getDocument()->addStyleSheet($staticUrl . 'style.css');
 }
開發者ID:vazahat,項目名稱:dudex,代碼行數:17,代碼來源:plugin.php

示例3: getMenuItems

 /**
  * Converts query result array into BASE_MenuItem items array.
  *
  * @param array $items
  */
 public function getMenuItems(array $menuItems)
 {
     $resultArray = array();
     foreach ($menuItems as $value) {
         $visible = (int) $value['visibleFor'];
         $auth = OW::getUser()->isAuthenticated();
         if ($visible === 0 || $visible === 1 && $auth || $visible === 2 && !$auth) {
             continue;
         }
         if (!empty($value['externalUrl'])) {
             $url = $value['externalUrl'];
         } else {
             if (!empty($value['uri'])) {
                 $url = OW::getRouter()->getBaseUrl() . $value['uri'];
             } else {
                 if (!empty($value['routePath'])) {
                     $url = OW::getRouter()->urlForRoute($value['routePath']);
                 } else {
                     if (!empty($value['class']) && !empty($value['action'])) {
                         $url = OW::getRouter()->urlFor($value['class'], $value['action']);
                     } else {
                         $url = '_INVALID_URL_';
                     }
                 }
             }
         }
         $menuItem = new BASE_MenuItem();
         $menuItem->setKey($value['menu_key']);
         $menuItem->setLabel(OW::getLanguage()->text($value['prefix'], $value['menu_key']));
         $menuItem->setOrder($value['order']);
         $menuItem->setUrl($url);
         $menuItem->setNewWindow($value['newWindow']);
         $menuItem->setPrefix($value['prefix']);
         $resultArray[] = $menuItem;
     }
     return $resultArray;
 }
開發者ID:ecki,項目名稱:oxwall,代碼行數:42,代碼來源:navigation_service.php


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