本文整理汇总了PHP中plugin类的典型用法代码示例。如果您正苦于以下问题:PHP plugin类的具体用法?PHP plugin怎么用?PHP plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了plugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
if ($identifier !== '') {
foreach ($identifier as $id) {
if (in_array($id, $enabled)) {
$return = $server->send_command("openqrm_server_plugin_command {$id} start");
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_start'], $id) . '<br>';
}
}
}
}
$this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:26,代码来源:aa_plugins.start.class.php
示例2: 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();
if ($identifier !== '') {
foreach ($identifier as $id) {
if (in_array($id, $enabled)) {
$error = false;
// check dependencies
foreach ($enabled as $v) {
if ($v !== $id) {
$tmp = $plugin->get_dependencies($v);
if ($tmp !== '' && isset($tmp['dependencies']) && $tmp['dependencies'] !== '') {
if (strpos($tmp['dependencies'], $id) !== false) {
$msg .= sprintf($this->lang['error_dependencies'], $id, $v) . '<br>';
$error = true;
}
}
}
}
// handle plugin type
if ($error === false) {
$tmp = $plugin->get_config($id);
switch ($tmp['type']) {
case 'storage':
$storage = new storage();
$types = $storage->get_storage_types();
$deployment = new deployment();
$dep = $deployment->get_id_by_storagetype($id);
foreach ($dep as $val) {
if (in_array($val['value'], $types)) {
$msg .= sprintf($this->lang['error_in_use'], $id) . '<br>';
$error = true;
}
}
break;
}
}
if ($error === false) {
$return = $server->send_command("openqrm_server_plugin_command " . $id . " uninstall " . $GLOBALS['OPENQRM_ADMIN']->name . ' ' . $GLOBALS['OPENQRM_ADMIN']->password);
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_disable'], $id) . '<br>';
}
}
}
}
}
$this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:59,代码来源:aa_plugins.disable.class.php
示例3: __construct
public function __construct()
{
parent::__construct();
$this->registry = registry::getInstance();
$this->html = html::getInstance();
$this->plugin = plugin::getInstance();
}
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:7,代码来源:appcontroller.php
示例4: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
// Only add the events if we are on that controller
if (Router::$controller == 'reports' and (Router::$method == 'view' or Router::$method == 'index')) {
plugin::add_stylesheet('printreport/css/print');
}
}
开发者ID:rjmackay,项目名称:Ushahidi-plugin-printreport,代码行数:10,代码来源:printreport.php
示例5: getClass
private static function getClass($_id)
{
if (get_called_class() != __CLASS__) {
return get_called_class();
}
$values = array('id' => $_id);
$sql = 'SELECT plugin,isEnable
FROM eqLogic
WHERE eqReal_id=:id';
$result = DB::Prepare($sql, $values, DB::FETCH_TYPE_ROW);
$eqTyme_name = $result['plugin'];
if ($result['isEnable'] == 0) {
try {
$plugin = null;
if ($eqTyme_name != '') {
$plugin = plugin::byId($eqTyme_name);
}
if (!is_object($plugin) || $plugin->isActive() == 0) {
return __CLASS__;
}
} catch (Exception $e) {
return __CLASS__;
}
}
if (class_exists($eqTyme_name)) {
if (method_exists($eqTyme_name, 'getClassCmd')) {
return $eqTyme_name::getClassCmd();
}
}
if (class_exists($eqTyme_name . 'Real')) {
return $eqTyme_name . 'Real';
}
return __CLASS__;
}
开发者ID:GaelGRIFFON,项目名称:core,代码行数:34,代码来源:eqReal.class.php
示例6: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
// Add a Sub-Nav Link
Event::add('ushahidi_action.nav_admin_reports', array($this, '_report_link'));
// Only add the events if we are on that controller
if (Router::$current_uri == "admin/reports") {
plugin::add_stylesheet('analysis/views/css/buttons');
// Add Buttons to the report List
Event::add('ushahidi_action.report_extra_admin', array($this, '_reports_list_buttons'));
} elseif (Router::$controller == 'analysis') {
plugin::add_javascript('analysis/views/js/ui.dialog');
plugin::add_javascript('analysis/views/js/ui.draggable');
plugin::add_javascript('analysis/views/js/ui.resizable');
plugin::add_stylesheet('analysis/views/css/main');
} elseif (strripos(Router::$current_uri, "admin/reports/edit") !== false) {
plugin::add_stylesheet('analysis/views/css/report');
plugin::add_javascript('analysis/views/js/jquery.copy.min');
Event::add('ushahidi_action.report_pre_form_admin', array($this, '_reports_list_analysis'));
Event::add('ushahidi_action.header_scripts_admin', array($this, '_save_analysis_js'));
Event::add('ushahidi_action.report_edit', array($this, '_save_analysis'));
} elseif (strripos(Router::$current_uri, "reports/submit") !== false) {
//Add dropdown fields to the submit form
Event::add('ushahidi_action.report_form', array($this, '_submit_form'));
//Save the contents of the dropdown
Event::add('ushahidi_action.report_submit', array($this, '_handle_post_data'));
Event::add('ushahidi_action.report_add', array($this, '_save_submit_form'));
}
}
开发者ID:rjmackay,项目名称:ushahidi-analysis,代码行数:31,代码来源:analysis.php
示例7: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
// Add a Sub-Nav Link
Event::add('ushahidi_action.nav_admin_settings', array($this, '_settings_link'));
Event::add('ushahidi_action.nav_main_top', array($this, '_top_nav_link'));
// Only add the events if we are on the main controller
if (Router::$controller == 'main') {
switch (Router::$method) {
// Hook into the main dashboard
case 'index':
plugin::add_stylesheet('flickrwijit/media/css/style');
plugin::add_stylesheet('../media/css/picbox/picbox');
plugin::add_javascript('../media/js/picbox');
Event::add('ushahidi_action.main_sidebar', array($this, '_display_flickrwiji'));
break;
}
} elseif (Router::$controller == 'flickrwijit') {
// Add Flickrwijit to settings page
switch (Router::$method) {
case 'index':
//Hook js and css files into flickrwijit page
plugin::add_stylesheet('flickrwijit/media/css/style');
plugin::add_stylesheet('../media/css/picbox/picbox');
plugin::add_javascript('../media/js/picbox');
break;
}
}
}
开发者ID:eyedol,项目名称:flickrwijit,代码行数:31,代码来源:flickrwijit.php
示例8: __construct
public function __construct()
{
parent::__construct();
// Set Table Prefix
$this->table_prefix = Kohana::config('database.default.table_prefix');
// Load Header & Footer
$this->template->header = new View('keitai/header');
$this->template->footer = new View('keitai/footer');
$this->template->header->site_name = Kohana::config('settings.site_name');
$this->template->header->site_tagline = Kohana::config('settings.site_tagline');
plugin::add_javascript('keitai/views/js/jquery');
plugin::add_javascript('keitai/views/js/jquery.treeview');
plugin::add_javascript('keitai/views/js/expand');
plugin::add_stylesheet('keitai/views/css/styles');
plugin::add_stylesheet('keitai/views/css/jquery.treeview');
$this->template->header->show_map = FALSE;
$this->template->header->js = "";
$this->template->header->breadcrumbs = "";
// Google Analytics
$google_analytics = Kohana::config('settings.google_analytics');
$this->template->footer->google_analytics = $this->_google_analytics($google_analytics);
$this->template->header->latlong = (isset($_GET['latlong'])) ? $_GET['latlong'] : "";
$this->template->footer->latlong = (isset($_GET['latlong'])) ? $_GET['latlong'] : "";
}
开发者ID:rindou240,项目名称:Ushahidi_Web,代码行数:31,代码来源:keitai.php
示例9: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
// Only add the events if we are on that controller
if (Router::$controller == 'reports') {
switch (Router::$method) {
// Hook into the Report Add/Edit Form in Admin
case 'edit':
// Hook into the form itself
Event::add('ushahidi_action.report_form_admin', array($this, '_report_form'));
// Hook into the report_submit_admin (post_POST) event right before saving
// Event::add('ushahidi_action.report_submit_admin', array($this, '_report_validate'));
// Hook into the report_edit (post_SAVE) event
Event::add('ushahidi_action.report_edit', array($this, '_report_form_submit'));
break;
// Hook into the Report view (front end)
// Hook into the Report view (front end)
case 'view':
plugin::add_stylesheet('actionable/views/css/actionable');
Event::add('ushahidi_action.report_meta', array($this, '_report_view'));
break;
}
} elseif (Router::$controller == 'feed') {
// Add Actionable Tag to RSS Feed
Event::add('ushahidi_action.feed_rss_item', array($this, '_feed_rss'));
}
}
开发者ID:redspider,项目名称:ushahidi-plugins-actionable,代码行数:29,代码来源:actionable.php
示例10: jeedomPluginAutoload
function jeedomPluginAutoload($classname)
{
$plugin = null;
try {
$plugin = plugin::byId($classname);
} catch (Exception $e) {
if (!is_object($plugin)) {
if (strpos($classname, 'Real') !== false) {
$plugin = plugin::byId(substr($classname, 0, -4));
}
if (!is_object($plugin) && strpos($classname, 'Cmd') !== false) {
$classname = str_replace('Cmd', '', $classname);
try {
$plugin = plugin::byId($classname);
} catch (Exception $e) {
if (strpos($classname, '_') !== false && strpos($classname, 'com_') === false) {
$plugin = plugin::byId(substr($classname, 0, strpos($classname, '_')));
}
}
}
if (!is_object($plugin) && strpos($classname, '_') !== false && strpos($classname, 'com_') === false) {
$plugin = plugin::byId(substr($classname, 0, strpos($classname, '_')));
}
}
}
try {
if (is_object($plugin)) {
if ($plugin->isActive() == 1) {
$include = $plugin->getInclude();
include_file('core', $include['file'], $include['type'], $plugin->getId());
}
}
} catch (Exception $e) {
}
}
开发者ID:GaelGRIFFON,项目名称:core,代码行数:35,代码来源:core.inc.php
示例11: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
if (Router::$controller == 'main') {
// Add stylesheet
plugin::add_stylesheet('categorycloud/views/css/categorycloud');
Event::add('ushahidi_action.main_sidebar', array($this, '_generate_cloud'));
}
}
开发者ID:nigelmcnie,项目名称:Ushahidi-plugin-categorycloud,代码行数:11,代码来源:categorycloud.php
示例12: load
public static function load($name)
{
if (self::isLoaded($name)) {
return;
}
$title = '';
$description = '';
$autoload = array();
require_once self::getPluginsPath() . $name . '/plugin.php';
$plugin = new plugin($name);
$plugin->setTitle($title);
$plugin->setDescription($description);
self::$_plugins[$name] = $plugin;
foreach ($autoload as $class => $filename) {
self::$_autoload[$class] = self::getPluginsPath() . $name . '/' . $filename;
}
}
开发者ID:ExceptVL,项目名称:kanon,代码行数:17,代码来源:plugins.php
示例13: add
public function add()
{
switch (Router::$current_uri) {
case "reports/download":
plugin::add_stylesheet('downloadreports/views/css/download_reports');
Event::add('ushahidi_action.header_scripts', array($this, '_add_scripts'));
break;
}
}
开发者ID:niiyatii,项目名称:crowdmap,代码行数:9,代码来源:download_reports.php
示例14: propertyForm
function propertyForm($param)
{
$id_form = $param[0];
$id_field = $param[1];
$field = $this->modelForm->renderFormByTable($id_form);
$field = $field["detail_field"];
for ($i = 1; $i < count($field); $i++) {
$result[$i]['kolom'] = $field[$i]['Field'];
$result[$i]['nama_label'] = explode(",", $field[$i]['Comment']);
$result[$i]['nama_label'] = $result[$i]['nama_label'][0];
}
// $this->loadExt("plugin");
$plg = new plugin();
echo $plg->encode_json($result);
///// Butuh Solusi //////////
////
//$this->loadView("fieldProperty",$data);
}
开发者ID:argotri,项目名称:GoBuilder,代码行数:18,代码来源:formManagement.php
示例15: add
/**
* Adds all other events for the plugin framework to the application
*/
public function add()
{
// Add the nexmo plugin to the list of SMS providers
plugin::add_sms_provider('nexmo');
// Add Nexmo CSS
plugin::add_stylesheet('nexmo/views/css/nexmo');
// Add event callbacks
Event::add('nexmo_action.update_message_log', array($this, 'update_message_log'));
}
开发者ID:uws-eresearch,项目名称:invisiblecity-ushahidi,代码行数:12,代码来源:nexmo.php
示例16: data_output
static function data_output($columns, $data, $db, $home)
{
$out = array();
for ($i = 0, $ien = count($data); $i < $ien; $i++) {
$row = array();
for ($j = 0, $jen = count($columns); $j < $jen; $j++) {
$column = $columns[$j];
// Is there a formatter?
if (isset($column['formatter'])) {
$row[$column['dt']] = $column['formatter']($data[$i][$column['db']], $data[$i]);
} else {
//var_dump($columns[$j]);
/// Buat Format Numeric
if (is_numeric($data[$i][$columns[$j]['db']])) {
$row[$column['dt']] = number_format($data[$i][$columns[$j]['db']]);
} else {
$row[$column['dt']] = $data[$i][$columns[$j]['db']];
}
///////////////// Sebagai Pengganti Join table ( Karena join table terlalu Mainstrum ) ////////////
if ($columns[$j]['join']['table'] != NULL) {
$value = $data[$i][$columns[$j]['db']];
$row[$column['dt']] = self::select($db, $columns[$j]['join']['table'], $columns[$j]['join']['field'], $data[$i][$columns[$j]['db']]);
}
/////////////////////// End Join Table
if ($columns[$j]['tipe'] == 'date') {
$plg = new plugin();
$row[$column['dt']] = $plg->tanggal2($data[$i][$columns[$j]['db']]);
}
if ($columns[$j]['tipe'] == 'file') {
$row[$column['dt']] = "<a href='" . $home . $data[$i][$columns[$j]['db']] . "' target='_blank'>Download</a>";
}
if ($columns[$j]['tipe'] == 'bool') {
if ($data[$i][$columns[$j]['db']] == 0) {
$row[$column['dt']] = "<i class='fa fa-times'></i> Salah";
} else {
$row[$column['dt']] = "<i class='fa fa-check'></i> Benar";
}
}
}
}
$out[] = $row;
}
return $out;
}
开发者ID:argotri,项目名称:GoBuilder,代码行数:44,代码来源:ssp.class.php
示例17: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$em =& $this->_pluginAPI->getEventManager();
$am->addAction(new action('adminUserManager', 'GET', array($this, 'onViewUserManager'), array(), array()));
$am->addAction(new action('adminMakeUserAdmin', 'POST', array($this, 'onMakeUserAdmin'), array(new IDInput('userID')), array()));
$am->addAction(new action('adminMakeUserNormal', 'POST', array($this, 'onMakeUserNormal'), array(new IDInput('userID')), array()));
$am->addAction(new action('adminUserDelete', 'GET', array($this, 'onDeleteUser'), array(new IDInput('userID')), array()));
}
开发者ID:BackupTheBerlios,项目名称:morgos-svn,代码行数:10,代码来源:users.admin.plugin.php
示例18: setup_adminmap
public static function setup_adminmap($map_controller, $map_view = "adminmap/mapview", $map_css = "adminmap/css/adminmap")
{
//set the CSS for this
plugin::add_stylesheet($map_css);
plugin::add_javascript("adminmap/js/jquery.flot");
plugin::add_javascript("adminmap/js/excanvas.min");
plugin::add_javascript("adminmap/js/timeline");
$map_controller->template->content = new View($map_view);
// Get Default Color
$map_controller->template->content->default_map_all = Kohana::config('settings.default_map_all');
}
开发者ID:huslage,项目名称:Ushahidi_Web,代码行数:11,代码来源:adminmap_helper.php
示例19: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$this->_adminPlugin = new viewPageCoreAdminPlugin($this->_loadedDir);
$this->_adminPlugin->load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$am->addAction(new action('viewPage', 'GET', array($this, 'onViewPage'), array(), array(new IDInput('pageID'), new LocaleInput('pageLang'))));
$em =& $this->_pluginAPI->getEventManager();
$em->addEvent(new Event('viewPage', array('pageID', 'pageLang')));
$em->subscribeToEvent('viewPage', new callback('setPageVars', array($this, 'setPageVars'), array('pageID', 'pageLang')));
}
开发者ID:BackupTheBerlios,项目名称:morgos-svn,代码行数:11,代码来源:viewpage.class.php
示例20: load
function load(&$pluginAPI)
{
include_once $this->getLoadedDir() . '/mailingList.class.php';
include_once $this->getLoadedDir() . '/mailingMember.class.php';
parent::load($pluginAPI);
$executor = array($this, 'onViewManager');
$requiredOptions = array();
$smth = new action('adminMailingListManager', 'GET', $executor, $requiredOptions);
$actionmanager =& $pluginAPI->getActionManager();
$actionmanager->addAction($smth);
}
开发者ID:BackupTheBerlios,项目名称:morgos-svn,代码行数:11,代码来源:maillist.plugin.php
注:本文中的plugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论