diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-01-19 20:12:52 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-01-19 20:12:52 +0100 |
commit | 0f569f4da813eb51aa75b3fe4a6e5c871b688eea (patch) | |
tree | 7db6c06417b07bb1bbaa5319d9605dfdcb21e1b0 /lib/plugins/plugin/admin.php | |
parent | 8426a3ee6fca3bd0fc582d6c405f5d30e12028d0 (diff) | |
parent | 30b90257784ae25a5e30c968b4c9391bb47ff1a1 (diff) | |
download | rpg-0f569f4da813eb51aa75b3fe4a6e5c871b688eea.tar.gz rpg-0f569f4da813eb51aa75b3fe4a6e5c871b688eea.tar.bz2 |
Merge branch 'extension_manager'
* extension_manager: (71 commits)
added plugins group to test
show a message when search returns no results
added missing localization
better filename parsing
use DOKU_LF
remove unneeded try/catch blocks
typo fix
purge cache only once on install
check for admin in AJAX backend
now use new core funtion to recursively delete
added status to info list of extension plugin
added css and html changes for RTL scripts to extension manager
added basic mobile styles to extension manager (not great, but makes things at least readable)
fixed and improved some HTML in extension manager
added git warning
fixed strict standard error and added some docblock
removed the old plugin manager
typo fix
protect authplain and current auth plugin
do not show updates for bundled plugins
...
Conflicts:
lib/plugins/plugin/lang/hu/admin_plugin.txt
lib/plugins/plugin/lang/hu/lang.php
Diffstat (limited to 'lib/plugins/plugin/admin.php')
-rw-r--r-- | lib/plugins/plugin/admin.php | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php deleted file mode 100644 index 3f019d5e2..000000000 --- a/lib/plugins/plugin/admin.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -/** - * Plugin management functions - * - * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) - * @author Christopher Smith <chris@jalakai.co.uk> - */ -// must be run within Dokuwiki -if(!defined('DOKU_INC')) die(); - -// todo -// - maintain a history of file modified -// - allow a plugin to contain extras to be copied to the current template (extra/tpl/) -// - to images (lib/images/) [ not needed, should go in lib/plugin/images/ ] - -require_once(DOKU_PLUGIN."/plugin/classes/ap_manage.class.php"); - -//--------------------------[ GLOBALS ]------------------------------------------------ -// note: probably should be dokuwiki wide globals, where they can be accessed by pluginutils.php -// global $plugin_types; -// $plugin_types = array('syntax', 'admin'); - -// plugins that are an integral part of dokuwiki, they shouldn't be disabled or deleted -global $plugin_protected; -$plugin_protected = array('acl','plugin','config','info','usermanager','revert'); - -/** - * All DokuWiki plugins to extend the admin function - * need to inherit from this class - */ -class admin_plugin_plugin extends DokuWiki_Admin_Plugin { - - var $disabled = 0; - var $plugin = ''; - var $cmd = ''; - - /** - * @var ap_manage - */ - var $handler = null; - - var $functions = array('delete','update',/*'settings',*/'info'); // require a plugin name - var $commands = array('manage','download','enable'); // don't require a plugin name - var $plugin_list = array(); - - var $msg = ''; - var $error = ''; - - function admin_plugin_plugin() { - $this->disabled = plugin_isdisabled('plugin'); - } - - /** - * return sort order for position in admin menu - */ - function getMenuSort() { - return 20; - } - - /** - * handle user request - */ - function handle() { - global $INPUT; - // enable direct access to language strings - $this->setupLocale(); - - $fn = $INPUT->param('fn'); - if (is_array($fn)) { - $this->cmd = key($fn); - $this->plugin = is_array($fn[$this->cmd]) ? key($fn[$this->cmd]) : null; - } else { - $this->cmd = $fn; - $this->plugin = null; - } - $this->_get_plugin_list(); - - // verify $_REQUEST vars - if (in_array($this->cmd, $this->commands)) { - $this->plugin = ''; - } else if (!in_array($this->cmd, $this->functions) || !in_array($this->plugin, $this->plugin_list)) { - $this->cmd = 'manage'; - $this->plugin = ''; - } - - if(($this->cmd != 'manage' || $this->plugin != '') && !checkSecurityToken()){ - $this->cmd = 'manage'; - $this->plugin = ''; - } - - // create object to handle the command - $class = "ap_".$this->cmd; - @require_once(DOKU_PLUGIN."/plugin/classes/$class.class.php"); - if (!class_exists($class)){ - $class = 'ap_manage'; - } - - $this->handler = new $class($this, $this->plugin); - $this->msg = $this->handler->process(); - - } - - /** - * output appropriate html - */ - function html() { - // enable direct access to language strings - $this->setupLocale(); - $this->_get_plugin_list(); - - if ($this->handler === null) $this->handler = new ap_manage($this, $this->plugin); - - ptln('<div id="plugin__manager">'); - $this->handler->html(); - ptln('</div><!-- #plugin_manager -->'); - } - - /** - * Returns a list of all plugins, including the disabled ones - */ - function _get_plugin_list() { - if (empty($this->plugin_list)) { - $list = plugin_list('',true); // all plugins, including disabled ones - sort($list); - trigger_event('PLUGIN_PLUGINMANAGER_PLUGINLIST',$list); - $this->plugin_list = $list; - } - return $this->plugin_list; - } - -} - - - - - - |