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


PHP plugin::started方法代碼示例

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


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

示例1: action

 function action()
 {
     $msg = '';
     $event = new event();
     $server = new openqrm_server();
     $plugin = new plugin();
     $identifier = $this->response->html->request()->get($this->identifier_name);
     $enabled = $plugin->enabled();
     $started = $plugin->started();
     if ($identifier !== '') {
         foreach ($identifier as $id) {
             if (in_array($id, $enabled) && in_array($id, $started)) {
                 $return = $server->send_command("openqrm_server_plugin_command {$id} stop");
                 if ($return === true) {
                     if ($this->__check($id)) {
                         $msg .= sprintf($this->lang['msg'], $id) . '<br>';
                     } else {
                         $msg .= sprintf($this->lang['error_timeout'], $id) . '<br>';
                     }
                 } else {
                     $msg .= sprintf($this->lang['error_stop'], $id) . '<br>';
                 }
             }
         }
     }
     $this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
 }
開發者ID:kelubo,項目名稱:OpenQRM,代碼行數:27,代碼來源:aa_plugins.stop.class.php

示例2: select

 function select()
 {
     $icon_started = $this->lang['action_stop'];
     $icon_stopped = $this->lang['action_start'];
     $icon_enabled = $this->lang['action_disable'];
     $icon_disabled = $this->lang['action_enable'];
     $plugin = new plugin();
     $plugins_available = $plugin->available();
     $plugins_enabled = $plugin->enabled();
     $plugins_started = $plugin->started();
     $h = array();
     $h['name']['title'] = $this->lang['table_name'];
     $h['type']['title'] = '&#160;';
     $h['type']['sortable'] = '&#160;';
     $h['type_n']['title'] = $this->lang['table_type'];
     $h['type_n']['hidden'] = true;
     $h['description']['title'] = $this->lang['table_description'];
     $h['description']['sortable'] = false;
     $h['configure']['title'] = "&#160;";
     $h['configure']['sortable'] = false;
     $h['enabled']['title'] = "&#160;";
     $h['enabled']['sortable'] = false;
     $h['enabled_n']['title'] = $this->lang['table_enabled'];
     $h['enabled_n']['hidden'] = true;
     $h['started']['title'] = "&#160;";
     $h['started']['sortable'] = false;
     $h['started_n']['title'] = $this->lang['table_started'];
     $h['started_n']['hidden'] = true;
     $table = $this->response->html->tablebuilder('plugins', $this->response->get_array($this->actions_name, 'select'));
     $table->max = count($plugins_available);
     $table->sort = 'name';
     $table->limit = 0;
     $table->order = 'ASC';
     $table->init();
     $tps = $table->get_params();
     $tp = '';
     foreach ($tps['plugins'] as $k => $v) {
         $tp .= '&plugins[' . $k . ']=' . $v;
     }
     $RootDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/';
     $thisfile = $this->response->html->thisfile;
     $b = array();
     $plugtype = array();
     $i = 0;
     $openqrm_version = $this->openqrm->get('config', 'SERVER_VERSION');
     foreach ($plugins_available as $index => $plugin_name) {
         $tmp = $plugin->get_config($plugin_name);
         $plugin_description = $tmp['description'];
         $plugin_type = $tmp['type'];
         $plugtype[] = $plugin_type;
         $plugin_version = $tmp['version'];
         $plugin_major = substr($plugin_version, 0, strpos($plugin_version, '.'));
         $plugin_minor = substr($plugin_version, strpos($plugin_version, '.') + 1);
         $plugin_minor = substr($plugin_minor, 0, strpos($plugin_minor, '.'));
         $plugin_base_version = $plugin_major . "." . $plugin_minor;
         if (!strlen($this->response->html->request()->get('plugin_filter')) || strstr($this->response->html->request()->get('plugin_filter'), $plugin_type)) {
             //
             $b[$i] = array();
             // plugin version mismatch
             if ($openqrm_version != $plugin_base_version) {
                 $b[$i]['name'] = $plugin_name;
                 $b[$i]['type'] = '<span class="pill ' . strtolower($plugin_type) . '">' . $plugin_type . '</span>';
                 $b[$i]['type_n'] = $plugin_type;
                 $b[$i]['description'] = $plugin_description;
                 $b[$i]['enabled'] = $this->lang['version_mismatch'];
                 $b[$i]['enabled_n'] = 'b';
                 $b[$i]['started'] = '&#160;';
                 $b[$i]['started_n'] = 'c';
                 $b[$i]['configure'] = '';
             } else {
                 // plugin not enabled!
                 if (!in_array($plugin_name, $plugins_enabled)) {
                     $a = $this->response->html->a();
                     $a->label = $icon_disabled;
                     $a->href = $this->response->get_url($this->actions_name, "enable");
                     $a->href .= '&' . $this->identifier_name . '[]=' . $plugin_name;
                     $a->href .= '&plugin_filter=' . $this->response->html->request()->get('plugin_filter');
                     $a->href .= $tp;
                     $a->href .= '#' . $plugin_name;
                     // anchor
                     $a->name = $plugin_name;
                     $a->handler = 'onclick="wait();"';
                     $a->css = 'enable';
                     $a->title = sprintf($this->lang['title_enable'], $plugin_name);
                     $b[$i]['name'] = $plugin_name;
                     $b[$i]['type'] = '<span class="pill ' . strtolower($plugin_type) . '">' . $plugin_type . '</span>';
                     $b[$i]['type_n'] = $plugin_type;
                     $b[$i]['description'] = $plugin_description;
                     $b[$i]['enabled'] = $a->get_string();
                     $b[$i]['enabled_n'] = 'b';
                     $b[$i]['started'] = '&#160;';
                     $b[$i]['started_n'] = 'c';
                 } else {
                     $plugin_icon_path = "{$RootDir}/plugins/{$plugin_name}/img/plugin.png";
                     $plugin_icon = "/openqrm/base/plugins/{$plugin_name}/img/plugin.png";
                     $plugin_icon_default = "/openqrm/base/plugins/aa_plugins/img/plugin.png";
                     if ($this->file->exists($plugin_icon_path)) {
                         $plugin_icon_default = $plugin_icon;
                     }
                     $a = $this->response->html->a();
//.........這裏部分代碼省略.........
開發者ID:kelubo,項目名稱:OpenQRM,代碼行數:101,代碼來源:aa_plugins.select.class.php

示例3: build_quicklinks

 private function build_quicklinks()
 {
     $quicklinks = array();
     $plugin = new plugin();
     $started_plugins = $plugin->started();
     // get list of running plugins
     foreach ($started_plugins as $plugin_name) {
         $hook_file = $this->openqrm->get('webdir') . "/plugins/" . $plugin_name . "/openqrm-" . $plugin_name . "-dashboard-quicklink-hook.php";
         if (file_exists($hook_file)) {
             require_once $hook_file;
             $hook_function = 'get_' . $plugin_name . '_dashboard_quicklink';
             if (function_exists($hook_function)) {
                 $link = $hook_function($this->response->html);
                 if (is_object($link)) {
                     $quicklinks[] = $link->get_string();
                 }
             }
         }
     }
     return $quicklinks;
 }
開發者ID:kelubo,項目名稱:OpenQRM,代碼行數:21,代碼來源:datacenter.dashboard.class.php


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