diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-06-26 11:07:20 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-06-26 11:07:20 +0200 |
commit | 5ddba4576a304c9e62b028c97ee466d79de12429 (patch) | |
tree | 03199c579f9302f0ed1e0b47f9c597a7f9bd2fc7 /inc/template.php | |
parent | 5114259bf530b89afbb21bd693b1da3f96016b7f (diff) | |
parent | 71c46303d9cd8a321e58a7e7255d13f0d5a5c4eb (diff) | |
download | rpg-5ddba4576a304c9e62b028c97ee466d79de12429.tar.gz rpg-5ddba4576a304c9e62b028c97ee466d79de12429.tar.bz2 |
Merge branch 'master' into styler
* master: (26 commits)
translation update
translation update
Replace old constructor call by __construct() in dokuwiki_xmlrpc_server
translation update
change two spaces to a space
translation update
translation update
translation update
translation update
Upgrade to jQuery 1.11.3 and jQueryUI 1.11.4 closes #1175
update confToHash() inline documentation for new parameter
translation update
Plugins can send usage data
fixed isBundled() check when remote info is unavailable
avoid accessing nonexistant array key. fixes #1165
translation update
Define the negation character in a constant
Ensure single value negation is not affected by white space differences
Ensure filtering only removes empty string values (not other values which PHP evaluates to false)
translation update
...
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/inc/template.php b/inc/template.php index fd8bff11a..95dc52deb 100644 --- a/inc/template.php +++ b/inc/template.php @@ -218,18 +218,9 @@ function tpl_toc($return = false) { $toc = array(); } } elseif($ACT == 'admin') { - // try to load admin plugin TOC FIXME: duplicates code from tpl_admin - $plugin = null; - $class = $INPUT->str('page'); - if(!empty($class)) { - $pluginlist = plugin_list('admin'); - if(in_array($class, $pluginlist)) { - // attempt to load the plugin - /** @var $plugin DokuWiki_Admin_Plugin */ - $plugin = plugin_load('admin', $class); - } - } - if( ($plugin !== null) && (!$plugin->forAdminOnly() || $INFO['isadmin']) ) { + // try to load admin plugin TOC + /** @var $plugin DokuWiki_Admin_Plugin */ + if ($plugin = plugin_getRequestAdminPlugin()) { $toc = $plugin->getTOC(); $TOC = $toc; // avoid later rebuild } @@ -1035,7 +1026,7 @@ function tpl_pageinfo($ret = false) { * @return bool|string */ function tpl_pagetitle($id = null, $ret = false) { - global $ACT, $INPUT, $lang; + global $ACT, $INPUT, $conf, $lang; if(is_null($id)) { global $ID; @@ -1054,17 +1045,10 @@ function tpl_pagetitle($id = null, $ret = false) { case 'admin' : $page_title = $lang['btn_admin']; // try to get the plugin name - // 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){ - $plugin_title = $plugin->getMenuText(); - $page_title = $plugin_title ? $plugin_title : $page; - } - } + /** @var $plugin DokuWiki_Admin_Plugin */ + if ($plugin = plugin_getRequestAdminPlugin()){ + $plugin_title = $plugin->getMenuText($conf['lang']); + $page_title = $plugin_title ? $plugin_title : $plugin->getPluginName(); } break; |