本文整理汇总了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));
}
示例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'] = ' ';
$h['type']['sortable'] = ' ';
$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'] = " ";
$h['configure']['sortable'] = false;
$h['enabled']['title'] = " ";
$h['enabled']['sortable'] = false;
$h['enabled_n']['title'] = $this->lang['table_enabled'];
$h['enabled_n']['hidden'] = true;
$h['started']['title'] = " ";
$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'] = ' ';
$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'] = ' ';
$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();
//.........这里部分代码省略.........
示例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;
}