当前位置: 首页>>代码示例>>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;未经允许,请勿转载。