Ejemplo n.º 1
0
 /**
  * Update active plugins list for manager.
  */
 public function readPluginsList()
 {
     $this->activePlugins = array();
     /* read all plugins from DB */
     $plugins = $this->pluginService->findActivePlugins();
     /* @var $value BOL_Plugin */
     foreach ($plugins as $value) {
         $this->activePlugins[$value->getKey()] = $value->isSystem ? new OW_SystemPlugin(array('dir_name' => $value->getModule(), 'key' => $value->getKey(), 'active' => $value->isActive(), 'dto' => $value)) : new OW_Plugin(array('dir_name' => $value->getModule(), 'key' => $value->getKey(), 'active' => $value->isActive(), 'dto' => $value));
     }
 }
Ejemplo n.º 2
0
 /**
  * Update active plugins list for manager.
  */
 public function readPluginsList()
 {
     $this->activePlugins = array();
     /* read all plugins from DB */
     $plugins = $this->pluginService->findActivePlugins();
     usort($plugins, array(__CLASS__, 'sortPlugins'));
     /* @var $value BOL_Plugin */
     foreach ($plugins as $value) {
         $this->activePlugins[$value->getKey()] = $this->pluginService->getPluginObject($value);
     }
 }
Ejemplo n.º 3
0
 /**
  * Returns plugin key for provided module name, works only for active plugins
  *
  * @param string $moduleName
  * @return string
  * @throws InvalidArgumentException
  */
 public function getPluginKey($moduleName)
 {
     $plugins = $this->pluginService->findActivePlugins();
     /* @var $plugin BOL_Plugin */
     foreach ($plugins as $plugin) {
         if ($plugin->getModule() == $moduleName) {
             return $plugin->getKey();
         }
     }
     throw new InvalidArgumentException("There is no plugin with module name `{$moduleName}`!");
 }