当前位置: 首页>>代码示例>>PHP>>正文


PHP PluginManager::getPlugin方法代码示例

本文整理汇总了PHP中PluginManager::getPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::getPlugin方法的具体用法?PHP PluginManager::getPlugin怎么用?PHP PluginManager::getPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginManager的用法示例。


在下文中一共展示了PluginManager::getPlugin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: return_column_plugins

 public static function return_column_plugins($c, $setting)
 {
     $col = array();
     foreach ($c->getPluginsBySetting($setting) as $name => $settings) {
         try {
             $col[] = PluginManager::getPlugin($name)->setSettings($settings);
         } catch (Exception $e) {
             Kohana::log('debug', $e->getMessage());
         }
     }
     return $col;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:12,代码来源:containers_helper.php

示例2: edit

 function edit($id, $name, $descr, $state, $strict, $type, $alarm_id, $others)
 {
     if (!isset($state)) {
         $state = 0;
     }
     if (!isset($strict)) {
         $strict = 0;
     }
     $pm = new PluginManager(PluginManager::PLUGIN_TYPE_CONTROL);
     $plugin = $pm->getPlugin($type);
     $plugin->storeForm($others);
     $code = $plugin->storeConfig();
     $sth = $this->pdo->prepare("UPDATE controllers SET name = ?, descr = ?, enabled = ?, strict = ?, control_type = ?, control_code = ?, alarm_id = ? WHERE id = ?");
     $res = $sth->execute(array($name, $descr, $state, $strict, $type, $code, $alarm_id, $id));
     if ($res == 0) {
         $errorInfo = $sth->errorInfo();
         throw new Exception("Impossible de modifier ce contrôleur: " . print_r($errorInfo, true));
     }
     $_SESSION["message"] = array("type" => "success", "title" => "Modification terminée", "descr" => "Le contrôleur a bien été modifié");
     header('Location: ' . '/monitoring/?v=dashboard&cat=controllers');
 }
开发者ID:yashodhank,项目名称:Monitoring,代码行数:21,代码来源:controller.php

示例3: __checkPluginControl

 private function __checkPluginControl($request)
 {
     $pm = new PluginManager(PluginManager::PLUGIN_TYPE_CONTROL);
     $controlName = $request["controlname"];
     $plugin = $pm->getPlugin($controlName);
     try {
         $res = $plugin->testControl();
         if ($res == false) {
             throw new Exception("Control has returned a FALSE value");
         }
     } catch (Exception $ex) {
         echo "0";
     }
     echo "1";
     exit(0);
 }
开发者ID:yashodhank,项目名称:Monitoring,代码行数:16,代码来源:ajax-script.php

示例4: ajax

 /**
  * get a plugin (via ajax)
  *
  * @return void
  * @author Andy Bennett
  */
 function ajax()
 {
     if ($this->uri->segment(3) == 'get_plugin_row') {
         $name = $this->input->post('name');
         $pm = new PluginManager();
         $plugin = $pm->getPlugin($name);
         $v = new View('plugin-row');
         $v->set('aplugin', $plugin);
         $v->aname = $name;
         $v->render(TRUE);
     }
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:18,代码来源:plugins_admin.php

示例5: get_plugins

 /**
  * get the plugins based on a setting
  *
  * @param string $setting 
  * @return void
  * @author Andy Bennett
  */
 public function get_plugins($setting)
 {
     if (!is_numeric($this->container_id)) {
         throw new Kohana_User_Exception("Containers Error", "The container has not been initialised");
     }
     $col = array();
     $res = $this->model->get_plugins_by_setting($this->container_id, $setting);
     foreach ($res as $plugin) {
         $name = $plugin->plugin_name;
         $settings = (array) $plugin;
         try {
             $col[] = PluginManager::getPlugin($name)->setSettings($settings);
         } catch (Exception $e) {
             Kohana::log('debug', $e->getMessage());
         }
     }
     return $col;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:25,代码来源:Container.php

示例6: assignCategoryControllers

 function assignCategoryControllers($tpl)
 {
     $action = isset($_REQUEST["a"]) ? $_REQUEST["a"] : "list";
     if ($action == "list") {
         $sth = $this->pdo->prepare("SELECT id, name, alarm_count, enabled FROM controllers");
         $sth->execute();
         $res = $sth->fetchAll();
         $tpl->assign('controllers_data', $res);
         $tpl->assign('view', 'view_dashboard_controllers');
     } else {
         if ($action == "add") {
             $item = array("id" => -1, "name" => "", "descr" => "", "enabled" => 1, "strict" => 0, "control_type" => "", "control_code" => "", "alarm_id" => 1);
             // Request for alarms
             $sth = $this->pdo->prepare("SELECT id, name FROM alarms");
             $sth->execute();
             $alarms = $sth->fetchAll();
             // Request for controls
             $pm = new PluginManager(PluginManager::PLUGIN_TYPE_CONTROL);
             $plugins = $pm->getPlugins();
             // Request current control
             $key = array_keys($plugins);
             $key = $key[0];
             $plugin = $plugins[$key];
             $ffh = new FieldFormHelper();
             $ffh->putFields($plugin->loadForm());
             $subformHtml = $ffh->getHTML();
             $tpl->assign('action', $action);
             $tpl->assign('item', $item);
             $tpl->assign('alarms_data', $alarms);
             $tpl->assign('controls_data', $plugins);
             $tpl->assign('subform_html', $subformHtml);
             $tpl->assign('view', 'view_dashboard_controllers_form');
         } else {
             if ($action == "edit") {
                 $sth = $this->pdo->prepare("SELECT id, name, descr, enabled, strict, control_type, control_code, alarm_id FROM controllers WHERE id = ?");
                 $sth->execute(array($_REQUEST["id"]));
                 $res = $sth->fetch(PDO::FETCH_ASSOC);
                 $item = $res;
                 // Request for alarms
                 $sth = $this->pdo->prepare("SELECT id, name FROM alarms");
                 $sth->execute();
                 $alarms = $sth->fetchAll();
                 // Request for controls
                 $pm = new PluginManager(PluginManager::PLUGIN_TYPE_CONTROL);
                 $plugins = $pm->getPlugins();
                 // Request current control
                 $plugin = $pm->getPlugin($item["control_type"]);
                 $plugin->loadConfig($item["control_code"]);
                 $ffh = new FieldFormHelper();
                 $ffh->putFields($plugin->loadForm());
                 $subformHtml = $ffh->getHTML();
                 $tpl->assign('action', $action);
                 $tpl->assign('item', $item);
                 $tpl->assign('alarms_data', $alarms);
                 $tpl->assign('controls_data', $plugins);
                 $tpl->assign('subform_html', $subformHtml);
                 $tpl->assign('view', 'view_dashboard_controllers_form');
             }
         }
     }
 }
开发者ID:yashodhank,项目名称:Monitoring,代码行数:61,代码来源:dashboard.php

示例7: get_page_plugins

 /**
  * get page plugins
  *
  * @param string $pid 
  * @return array
  * @author Andy Bennett
  */
 public static function get_page_plugins($pid, $plugin_name = NULL)
 {
     $plug_table = Kohana::config('appconf.page_plugins_table');
     if (is_null($plug_table)) {
         $plug_table = 'page_plugins';
     }
     $db = new SteamDatabase();
     $db->select('*')->from($plug_table)->where(array('pid' => $pid));
     if (isset($plugin_name)) {
         $db->orwhere(array('plugin_name' => $plugin_name));
     }
     $db->orderby('order');
     $c = $db->get_result();
     $col = array();
     foreach ($c as $p) {
         $name = $p->plugin_name;
         $settings = array();
         // $settings['column'] = $p->column;
         $settings['order'] = $p->order;
         $settings['template'] = $p->template;
         try {
             $col[] = PluginManager::getPlugin($name)->setSettings($settings);
         } catch (Exception $e) {
             Kohana::log('debug', $e->getMessage());
         }
     }
     return $col;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:35,代码来源:containers_helper.php

示例8: display

 /**
  * Sends data to ViewManager
  * 
  * @access private
  * @param array Result
  */
 private function display($result)
 {
     $request = $this->pluginManager->getPlugin('router')->getRequest();
     $view = $request['view'];
     $vm = new ViewManager($view, $result, $this->user);
 }
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:12,代码来源:Odin.php


注:本文中的PluginManager::getPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。