diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2015-05-16 19:07:23 +0200 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2015-05-16 19:07:23 +0200 |
commit | a61966c55d9d0ac4b800d65cfc6ee1aea44899b5 (patch) | |
tree | ac4dc0bb88c5efe6e0fdcb834f3a185eb6741fe7 /inc/actions.php | |
parent | c248bda1dcbef2068071904057b8410aa1eb0200 (diff) | |
download | rpg-a61966c55d9d0ac4b800d65cfc6ee1aea44899b5.tar.gz rpg-a61966c55d9d0ac4b800d65cfc6ee1aea44899b5.tar.bz2 |
Provide a function to return admin plugin for the page request.
This was previously carried out in three separate places. Refactor
that code to use the new function.
Update tpl_pageTitle test to use a manager level admin plugin.
Diffstat (limited to 'inc/actions.php')
-rw-r--r-- | inc/actions.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/inc/actions.php b/inc/actions.php index 709c19ddd..b0753b22e 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -162,20 +162,9 @@ function act_dispatch(){ if($ACT == 'admin'){ // retrieve admin plugin name from $_REQUEST['page'] if (($page = $INPUT->str('page', '', true)) != '') { - $pluginlist = plugin_list('admin'); - if (in_array($page, $pluginlist)) { - // attempt to load the plugin - - if (($plugin = plugin_load('admin',$page)) !== null){ - /** @var DokuWiki_Admin_Plugin $plugin */ - if($plugin->forAdminOnly() && !$INFO['isadmin']){ - // a manager tried to load a plugin that's for admins only - $INPUT->remove('page'); - msg('For admins only',-1); - }else{ - $plugin->handle(); - } - } + /** @var $plugin DokuWiki_Admin_Plugin */ + if ($plugin = plugin_getRequestAdminPlugin()){ + $plugin->handle(); } } } |