summaryrefslogtreecommitdiff
path: root/lib/plugins/extension/action.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-09 23:55:39 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-08-09 23:55:39 +0200
commit72dda0b4378651b271f5fb516fb8e21a80ac3ebf (patch)
tree051174bdce5b4b228ae2676fcb585edccf04efbf /lib/plugins/extension/action.php
parent75e063084d865a011e074c29c5edb8569fe2cfe1 (diff)
downloadrpg-72dda0b4378651b271f5fb516fb8e21a80ac3ebf.tar.gz
rpg-72dda0b4378651b271f5fb516fb8e21a80ac3ebf.tar.bz2
added AJAX detail infos
Diffstat (limited to 'lib/plugins/extension/action.php')
-rw-r--r--lib/plugins/extension/action.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/plugins/extension/action.php b/lib/plugins/extension/action.php
new file mode 100644
index 000000000..b35c1cb13
--- /dev/null
+++ b/lib/plugins/extension/action.php
@@ -0,0 +1,51 @@
+<?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');
+
+ }
+
+ public function info(Doku_Event &$event, $param){
+ global $INPUT;
+ 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);
+ }
+
+}
+