本文整理汇总了PHP中plugins类的典型用法代码示例。如果您正苦于以下问题:PHP plugins类的具体用法?PHP plugins怎么用?PHP plugins使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了plugins类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_delete_officepack
function plugin_delete_officepack()
{
$object = new plugins();
$object->del_cd_entry("officepack");
$object->del_menu("officepack", "14000", "Office Key Management", "plugins");
$object->sql_query("DROP TABLE IF EXISTS `officepack_sku` , `officepack_lang` , `officepack_type` , `officepack_version` , `officepack`;");
}
示例2: index
public function index()
{
$this->template->content = new View('generic/grid');
// Setup the base grid object
$grid = jgrid::grid($this->baseModel, array(
'caption' => 'Network Lists'
)
);
// Add the base model columns to the grid
$grid->add('net_list_id', 'ID', array(
'hidden' => true,
'key' => true
)
);
$grid->add('name', 'Name');
// Add the actions to the grid
$grid->addAction('netlistmanager/edit', 'Edit', array(
'arguments' => 'net_list_id'
)
);
$grid->addAction('netlistmanager/delete', 'Delete', array(
'arguments' => 'net_list_id'
)
);
// Let plugins populate the grid as well
$this->grid = $grid;
plugins::views($this);
// Produce a grid in the view
$this->view->grid = $this->grid->produce();
}
示例3: news_feed
static function news_feed()
{
$p = plugins::getinst();
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>";
echo "<rss version=\"2.0\">";
echo "<channel>";
echo "<title>News di OpenGdr </title>";
echo "<link>http://mtgforum.altervista.org/</link>";
echo "<description>News di opengdr</description>";
echo "<copyright>Copyright 2009 Bacis Marco </copyright>\n";
echo "<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
echo "<managingEditor>" . config::email . "</managingEditor>\n";
echo "<webMaster>" . config::email . "</webMaster>\n";
echo "<language>IT-it</language>\n";
$newss = $p->d->getresults('SELECT * FROM news ORDER BY id DESC;');
foreach ($newss as $news) {
$data = explode(' ', $news->date);
$data = $data[0];
$text = stripslashes(htmlentities(substr($news->text, 0, 50)));
$text = str_replace('<', '', $text);
$text = str_replace('>', '', $text);
echo "<item>\r\n\t\t<title>Aggiornamento del " . $data . "</title>\r\n\t\t<pubDate>" . $news->date . "</pubDate>\r\n\t\t<link>http://mtgforum.altervista.org/</link>\r\n\t\t<description>" . $text . "...</description>\r\n\t\t</item>\n";
}
echo "</channel></rss>";
}
示例4: index
public function index()
{
$this->template->content = new View('generic/grid');
// Setup the base grid object
$grid = jgrid::grid($this->baseModel, array('caption' => 'Users'));
// Add the base model columns to the grid
$grid->add('user_id', 'ID', array('hidden' => TRUE, 'key' => TRUE));
$grid->add('email_address', 'Email Address');
$grid->add('first_name', 'First Name', array('width' => '100', 'search' => TRUE));
$grid->add('last_name', 'Last Name', array('width' => '100', 'search' => TRUE));
$grid->add('Location/name', 'Location', array('width' => '100', 'search' => TRUE, 'sortable' => TRUE));
$grid->add('user_type', 'User Type', array('callback' => array('function' => array($this, 'userType'), 'arguments' => array('user_type'))));
$grid->add('logins', 'Logins', array('hidden' => TRUE));
$grid->add('last_login', 'Last Login', array('hidden' => TRUE));
$grid->add('last_logged_ip', 'Last Logged IP', array('hidden' => TRUE));
$grid->add('debug_level', 'Debug Level', array('hidden' => TRUE));
// Add the actions to the grid
$grid->addAction('usermanager/edit', 'Edit', array('arguments' => 'user_id'));
$grid->addAction('usermanager/delete', 'Delete', array('arguments' => 'user_id'));
if (users::getAttr('user_type') == User::TYPE_SYSTEM_ADMIN) {
$grid->addAction('usermanager/login', 'Login', array('arguments' => 'user_id'));
}
// Let plugins populate the grid as well
$this->grid = $grid;
plugins::views($this);
// Produce a grid in the view
$this->view->grid = $this->grid->produce();
}
示例5: show_online
/**
* Вывод списка online-пользователей
* @return null
*/
public function show_online()
{
$i = (int) config::o()->v('online_interval');
if (!$i) {
$i = 15;
}
$time = time() - $i;
$res = db::o()->p($time)->query('SELECT userdata FROM sessions
WHERE time > ? GROUP BY IF(uid>0,uid,ip)');
$res = db::o()->fetch2array($res);
tpl::o()->assign("res", $res);
$c = count($res);
$mo = stats::o()->read("max_online");
if (!intval($mo) || $mo < $c) {
$mo = $c;
stats::o()->write("max_online", $c);
stats::o()->write("max_online_time", time());
}
$mot = stats::o()->read("max_online_time");
tpl::o()->assign("record_total", $mo);
tpl::o()->assign("record_time", $mot);
/* @var $user user */
$user = plugins::o()->get_module("user");
lang::o()->get("profile");
tpl::o()->register_modifier("gau", array($user, "get_age"));
tpl::o()->assign("bdl", $this->bd_list());
tpl::o()->display("blocks/contents/online.tpl");
}
示例6: mod_pg
static function mod_pg($pg)
{
$p = plugins::getinst();
$user = $p->d->getrow('SELECT * FROM users WHERE name="' . $pg . '";');
if ($user->account_id == $_SESSION['datiaccount']['id']) {
$t = new template('template/mod_pg.tpl');
$t->assign_var('PG_NAME', $pg);
if ($_POST) {
$query = 'UPDATE users SET description="' . $_POST['desc'] . '",image="' . $_POST['image'] . '" WHERE name="' . $pg . '";';
$upd = $p->d->query($query);
if (!$upd) {
$t->start_block('mod_failed');
$t->end_block('mod_failed');
} else {
$t->start_block('mod_success');
$t->end_block('mod_success');
}
} else {
$t->start_block('mod_failed');
$t->end_block('mod_failed');
}
$p->action('mod_pg');
$t->out();
}
}
示例7: guestbook_page
static function guestbook_page()
{
$p = plugins::getinst();
$t = new template('template/guestbook.tpl');
//Eseguo l'azione "guestbook_page"
$p->action('guestbook_page');
//Se il messaggio non è vuoto
if (!empty($_POST['message'])) {
//Variabili
$username = mysql_real_escape_string(htmlentities($_POST['username']));
$text = mysql_real_escape_string(htmlentities($_POST['message']));
//Imposto un filtro sul messaggio
$text = $p->filter('guestbook_message_send', $text);
//Eseguo la query e ne controllo l'esito
$query = 'INSERT INTO guestbook SET username="' . $username . '",text="' . $text . '",time=NOW();';
if ($p->d->query($query)) {
$t->block_null('new_success');
}
}
//Eseguo la query per selezionare tutti i messaggi
$select = 'SELECT * FROM guestbook ORDER BY time DESC;';
$messaggi = $p->d->getresults($select);
//Aggiungo i messaggi al template
foreach ($messaggi as $m) {
$t->block_assign('message', array('USERNAME' => $m->username, 'MESSAGE' => $m->text));
}
$t->out();
}
示例8: getinst
public static function getinst()
{
global $d;
if (self::$inst == NULL) {
self::$inst = new plugins($d);
}
return self::$inst;
}
示例9: index
public function index()
{
$this->template->content = new View('generic/grid');
// Setup the base grid object
$this->grid = jgrid::grid($this->baseModel, array('caption' => 'Domains'))->add('id', 'ID', array('hidden' => true, 'key' => true))->add('name', 'Domain Name/Realm')->add('recordCount', 'Records', array('search' => false, 'align' => 'center', 'callback' => array('function' => array($this, 'countRecords'), 'arguments' => array('id'))))->navButtonAdd('Columns', array('onClickButton' => 'function () { $(\'#{table_id}\').setColumns(); }', 'buttonimg' => url::base() . 'assets/css/jqGrid/table_insert_column.png', 'title' => 'Show/Hide Columns', 'noCaption' => true, 'position' => 'first'))->addAction('powerdns/edit', 'Edit', array('arguments' => 'id', 'width' => '120'))->addAction('powerdns/delete', 'Delete', array('arguments' => 'id', 'width' => '20'));
// dont foget to let the plugins add to the grid!
plugins::views($this);
$this->view->grid = $this->grid->produce();
}
示例10: init
/**
* Инициализация плагина
* @param plugins $plugins объект плагиновой системы
* @return null
* @note Здесь настраивается, какие классы плагин переопределяет,
* расширяет, какие хуки задействованы.
*/
public function init($plugins)
{
// Полный мануал смотрите на http://ctrev.cyber-tm.ru
$plugins->add_hook('torrents_show_begin', array($this, 'torrents_show_begin'));
$plugins->extend_class('content', 'my_torrents');
$plugins->preload('cleanup', 'modify_var', array('methods', 'empty'));
$plugins->preload('cleanup', 'add_method', array('clear_empty', array($this, 'clear_empty')));
$plugins->modify_init('content', array($this, 'torrents_init'));
}
示例11: index
public function index()
{
$this->template->content = new View('generic/grid');
// Setup the base grid object
$this->grid = jgrid::grid('FaxProfile', array('caption' => 'Fax Profiles'))->add('fxp_id', 'ID', array('hidden' => true, 'key' => true))->add('fxp_name', 'Name')->add('fxp_default', 'Default')->addAction('fax/edit', 'Edit', array('arguments' => 'fxp_id'))->addAction('fax/delete', 'Delete', array('arguments' => 'fxp_id'));
// Let plugins populate the grid as well
plugins::views($this);
// Produce a grid in the view
$this->view->grid = $this->grid->produce();
}
示例12: activate_core_plugins
/**
* Automatically activate some core plugins
*/
function activate_core_plugins()
{
include_once PHPWG_ROOT_PATH . 'admin/include/plugins.class.php';
$plugins = new plugins();
foreach ($plugins->fs_plugins as $plugin_id => $fs_plugin) {
if (in_array($plugin_id, array('TakeATour'))) {
$plugins->perform_action('activate', $plugin_id);
}
}
}
示例13: index
public function index()
{
$this->template->content = new View('generic/grid');
// Build a grid with a hidden device_id, class_type, and add an option for the user to select the display columns
$this->grid = jgrid::grid($this->baseModel, array('caption' => 'My ODBC Connections', 'multiselect' => true))->add('odbc_id', 'ID', array('hidden' => true, 'key' => true))->add('dsn_name', 'DSN Name', array('width' => '60'))->add('description', 'Description', array('width' => '120'))->add('host', 'Host', array('width' => '60'))->add('user', 'User', array('width' => '50'))->add('type', 'Type', array('width' => '30'))->add('port', 'port', array('width' => '30'))->navButtonAdd('Columns', array('onClickButton' => 'function () { $(\'#{table_id}\').setColumns(); }', 'buttonimg' => url::base() . 'assets/css/jqGrid/table_insert_column.png', 'title' => 'Show/Hide Columns', 'noCaption' => true, 'position' => 'first'))->addAction('odbc/edit', 'Edit', array('arguments' => 'odbc_id', 'width' => '40'))->addAction('odbc/delete', 'Delete', array('arguments' => 'odbc_id', 'width' => '40'))->addAction('odbc/config', 'odbc.ini', array('arguments' => 'odbc_id', 'width' => '60'))->navGrid(array('del' => true));
// dont foget to let the plugins add to the grid!
plugins::views($this);
// Produces the grid markup or JSON, respectively
$this->view->grid = $this->grid->produce();
}
示例14: ws_plugins_performAction
/**
* API method
* Performs an action on a plugin
* @param mixed[] $params
* @option string action
* @option string plugin
* @option string pwg_token
*/
function ws_plugins_performAction($params, $service)
{
global $template;
if (get_pwg_token() != $params['pwg_token']) {
return new PwgError(403, 'Invalid security token');
}
define('IN_ADMIN', true);
include_once PHPWG_ROOT_PATH . 'admin/include/plugins.class.php';
$plugins = new plugins();
$errors = $plugins->perform_action($params['action'], $params['plugin']);
if (!empty($errors)) {
return new PwgError(500, $errors);
} else {
if (in_array($params['action'], array('activate', 'deactivate'))) {
$template->delete_compiled_templates();
}
return true;
}
}
示例15: install
/**
* Установка плагина
* @param bool $re переустановка?
* в данном случае необходимо лишь произвести изменения в файлах
* @return bool статус установки
* @note метод может возвращать false или 0, в случае, если была какая-то
* критическая ошибка при удалении
*/
public function install($re = false)
{
if (!$re) {
config::o()->add('recaptcha_public_key', '', 'string', '', 'register');
config::o()->add('recaptcha_private_key', '', 'string', '', 'register');
}
plugins::o()->insert_template('captcha.tpl', '[*recaptcha_show*][**');
plugins::o()->insert_template('captcha.tpl', '**]', false);
return true;
}