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/extension/action.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/extension/action.php')
-rw-r--r-- | lib/plugins/extension/action.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/plugins/extension/action.php b/lib/plugins/extension/action.php new file mode 100644 index 000000000..9dd1648ff --- /dev/null +++ b/lib/plugins/extension/action.php @@ -0,0 +1,65 @@ +<?php +/** DokuWiki Plugin extension (Action Component) + * + * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html + * @author Andreas Gohr <andi@splitbrain.org> + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +class action_plugin_extension extends DokuWiki_Action_Plugin { + + /** + * Registers a callback function for a given event + * + * @param Doku_Event_Handler $controller DokuWiki's event controller object + * @return void + */ + public function register(Doku_Event_Handler $controller) { + + $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'info'); + + } + + /** + * Create the detail info for a single plugin + * + * @param Doku_Event $event + * @param $param + */ + public function info(Doku_Event &$event, $param){ + global $USERINFO; + global $INPUT; + + if(empty($_SERVER['REMOTE_USER']) || !auth_isadmin($_SERVER['REMOTE_USER'], $USERINFO['grps'])){ + http_status(403); + echo 'Forbidden'; + exit; + } + + if($event->data != 'plugin_extension') return; + $event->preventDefault(); + $event->stopPropagation(); + + header('Content-Type: text/html; charset=utf-8'); + + $ext = $INPUT->str('ext'); + if(!$ext) { + echo 'no extension given'; + return; + } + + /** @var helper_plugin_extension_extension $extension */ + $extension = plugin_load('helper', 'extension_extension'); + $extension->setExtension($ext); + + /** @var helper_plugin_extension_list $list */ + $list = plugin_load('helper', 'extension_list'); + + + echo $list->make_info($extension); + } + +} + |