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


PHP PluginManager::getPlugins方法代碼示例

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


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

示例1: loadItems

 /**
  * Loads the menu items from modules and plugins
  * @return void
  */
 protected function loadItems()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         $items = $plugin->registerNavigation();
         if (!is_array($items)) {
             continue;
         }
         $this->registerMenuItems($id, $items);
     }
     /*
      * Extensibility
      */
     Event::fire('backend.menu.extendItems', [$this]);
     /*
      * Sort menu items
      */
     uasort($this->items, function ($a, $b) {
         return $a->order - $b->order;
     });
     /*
      * Filter items user lacks permission for
      */
     $user = BackendAuth::getUser();
     $this->items = $this->filterItemPermissions($user, $this->items);
     foreach ($this->items as $item) {
         if (!$item->sideMenu || !count($item->sideMenu)) {
             continue;
         }
         /*
          * Apply incremental default orders
          */
         $orderCount = 0;
         foreach ($item->sideMenu as $sideMenuItem) {
             if ($sideMenuItem->order !== -1) {
                 continue;
             }
             $sideMenuItem->order = $orderCount += 100;
         }
         /*
          * Sort side menu items
          */
         uasort($item->sideMenu, function ($a, $b) {
             return $a->order - $b->order;
         });
         /*
          * Filter items user lacks permission for
          */
         $item->sideMenu = $this->filterItemPermissions($user, $item->sideMenu);
     }
 }
開發者ID:aaronleslie,項目名稱:aaronunix,代碼行數:64,代碼來源:NavigationManager.php

示例2: loadExtensions

 protected function loadExtensions()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         $items = $plugin->registerMarkupTags();
         if (!is_array($items)) {
             continue;
         }
         foreach ($items as $type => $definitions) {
             if (!is_array($definitions)) {
                 continue;
             }
             $this->registerExtensions($type, $definitions);
         }
     }
 }
開發者ID:Rudianasaja,項目名稱:october,代碼行數:25,代碼來源:MarkupManager.php

示例3: listReportWidgets

 /**
  * Returns a list of registered report widgets.
  * @return array Array keys are class names.
  */
 public function listReportWidgets()
 {
     if ($this->reportWidgets === null) {
         $this->reportWidgets = [];
         /*
          * Load module widgets
          */
         foreach ($this->reportWidgetCallbacks as $callback) {
             $callback($this);
         }
         /*
          * Load plugin widgets
          */
         $plugins = $this->pluginManager->getPlugins();
         foreach ($plugins as $plugin) {
             if (!is_array($widgets = $plugin->registerReportWidgets())) {
                 continue;
             }
             foreach ($widgets as $className => $widgetInfo) {
                 $this->registerReportWidget($className, $widgetInfo);
             }
         }
     }
     return $this->reportWidgets;
 }
開發者ID:GoldBest,項目名稱:october,代碼行數:29,代碼來源:WidgetManager.php

示例4: loadResources

 public function loadResources()
 {
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         if (!method_exists($plugin, 'registerAPIResources')) {
             continue;
         }
         $resources = $plugin->registerAPIResources();
         if (!is_array($resources)) {
             continue;
         }
         $this->registerResources($resources);
     }
 }
開發者ID:gpasztor87,項目名稱:oc-api-plugin,代碼行數:17,代碼來源:ApiManager.php

示例5: loadItems

 protected function loadItems()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         $items = $plugin->registerSettings();
         if (!is_array($items)) {
             continue;
         }
         $this->registerSettingItems($id, $items);
     }
     /*
      * Sort settings items
      */
     usort($this->items, function ($a, $b) {
         return $a->order - $b->order;
     });
     /*
      * Filter items user lacks permission for
      */
     $user = BackendAuth::getUser();
     $this->items = $this->filterItemPermissions($user, $this->items);
     /*
      * Process each item in to a category array
      */
     $catItems = [];
     foreach ($this->items as $item) {
         $category = $item->category ?: 'Misc';
         if (!isset($catItems[$category])) {
             $catItems[$category] = [];
         }
         $catItems[$category][] = $item;
     }
     $this->allItems = $this->items;
     $this->items = $catItems;
 }
開發者ID:360weboy,項目名稱:october,代碼行數:44,代碼來源:SettingsManager.php

示例6: loadItems

 /**
  * Loads the menu items from modules and plugins
  * @return void
  */
 protected function loadItems()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         $items = $plugin->registerNavigation();
         if (!is_array($items)) {
             continue;
         }
         $this->registerMenuItems($id, $items);
     }
     /*
      * Sort menu items
      */
     usort($this->items, function ($a, $b) {
         if ($a->order == $b->order) {
             return 0;
         }
         return $a->order > $b->order ? 1 : -1;
     });
     /*
      * Filter items user lacks permission for
      */
     $user = BackendAuth::getUser();
     $this->items = $this->filterItemPermissions($user, $this->items);
     foreach ($this->items as $item) {
         if (!$item->sideMenu || !count($item->sideMenu)) {
             continue;
         }
         $item->sideMenu = $this->filterItemPermissions($user, $item->sideMenu);
     }
 }
開發者ID:janusnic,項目名稱:october-heroku,代碼行數:44,代碼來源:NavigationManager.php

示例7: loadGateways

 /**
  * Loads the menu items from modules and plugins
  * @return void
  */
 protected function loadGateways()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         if (!method_exists($plugin, 'registerPaymentGateways')) {
             continue;
         }
         $gateways = $plugin->registerPaymentGateways();
         if (!is_array($gateways)) {
             continue;
         }
         $this->registerGateways($id, $gateways);
     }
 }
開發者ID:chesterx,項目名稱:pay-plugin,代碼行數:27,代碼來源:GatewayManager.php

示例8: loadNotifications

 /**
  * Loads the notifications from modules and plugins
  *
  * @return void
  */
 protected function loadNotifications()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         if (!method_exists($plugin, 'registerNotifications')) {
             continue;
         }
         $notifications = $plugin->registerNotifications();
         if (!is_array($notifications)) {
             continue;
         }
         $this->registerNotifications($id, $notifications);
     }
 }
開發者ID:gpasztor87,項目名稱:oc-notifications-plugin,代碼行數:28,代碼來源:NotificationManager.php

示例9: loadConverters

 /**
  * Loads the menu items from modules and plugins
  * @return void
  */
 protected function loadConverters()
 {
     /*
      * Load module items
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*
      * Load plugin items
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $id => $plugin) {
         if (!method_exists($plugin, 'registerCurrencyConverters')) {
             continue;
         }
         $converters = $plugin->registerCurrencyConverters();
         if (!is_array($converters)) {
             continue;
         }
         $this->registerConverters($id, $converters);
     }
 }
開發者ID:responsiv,項目名稱:currency-plugin,代碼行數:27,代碼來源:ExchangeManager.php


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