diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-06-06 12:10:45 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-06-06 12:10:45 +0200 |
commit | 10271ce404f0c9bef254b22ad4258ac6355e22cc (patch) | |
tree | 0a5354500905dc75592a32482bdd5827b9593074 /inc | |
parent | b860e7b4685b5defd19f79bea841b0e71a4de075 (diff) | |
download | rpg-10271ce404f0c9bef254b22ad4258ac6355e22cc.tar.gz rpg-10271ce404f0c9bef254b22ad4258ac6355e22cc.tar.bz2 |
Redesigned admin screen
Ignore-this: a0d2db2839de9eacbd6a853c39ed592c
This patch reorders the admin screen to make the main tasks better accessible.
This was inspired by a similar plugin by Håkan Sandell [1]
[1] http://www.dokuwiki.org/plugin:adminhomepage
darcs-hash:20090606101045-7ad00-83fbb0dd3af288f66801b796387e4ec3d411d4c9.gz
Diffstat (limited to 'inc')
-rw-r--r-- | inc/html.php | 111 | ||||
-rw-r--r-- | inc/lang/en/adminplugins.txt | 2 |
2 files changed, 84 insertions, 29 deletions
diff --git a/inc/html.php b/inc/html.php index 8c555bbbe..72af8f18a 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1332,40 +1332,93 @@ function html_debug(){ print '</body></html>'; } +/** + * List available Administration Tasks + * + * @author Andreas Gohr <andi@splitbrain.org> + * @author Håkan Sandell <hakan.sandell@home.se> + */ function html_admin(){ - global $ID; - global $INFO; - global $lang; - global $conf; - - print p_locale_xhtml('admin'); - - // build menu of admin functions from the plugins that handle them - $pluginlist = plugin_list('admin'); - $menu = array(); - foreach ($pluginlist as $p) { - if($obj =& plugin_load('admin',$p) === NULL) continue; - - // check permissions - if($obj->forAdminOnly() && !$INFO['isadmin']) continue; - - $menu[] = array('plugin' => $p, - 'prompt' => $obj->getMenuText($conf['lang']), - 'sort' => $obj->getMenuSort() - ); - } + global $ID; + global $INFO; + global $lang; + global $conf; + global $auth; - usort($menu, 'p_sort_modes'); + // build menu of admin functions from the plugins that handle them + $pluginlist = plugin_list('admin'); + $menu = array(); + foreach ($pluginlist as $p) { + if($obj =& plugin_load('admin',$p) === NULL) continue; - // output the menu - ptln('<ul>'); + // check permissions + if($obj->forAdminOnly() && !$INFO['isadmin']) continue; - foreach ($menu as $item) { - if (!$item['prompt']) continue; - ptln(' <li><div class="li"><a href="'.wl($ID, 'do=admin&page='.$item['plugin']).'">'.$item['prompt'].'</a></div></li>'); - } + $menu[$p] = array('plugin' => $p, + 'prompt' => $obj->getMenuText($conf['lang']), + 'sort' => $obj->getMenuSort() + ); + } - ptln('</ul>'); + print p_locale_xhtml('admin'); + + // Admin Tasks + if($INFO['isadmin']){ + ptln('<ul class="admin_tasks">'); + + if($auth && $auth->canDo('getUsers')){ + ptln(' <li class="admin_usermanager"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'usermanager')).'">'. + $menu['usermanager']['prompt'].'</a></div></li>'); + } + unset($menu['usermanager']); + + ptln(' <li class="admin_acl"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'acl')).'">'. + $menu['acl']['prompt'].'</a></div></li>'); + unset($menu['acl']); + + ptln(' <li class="admin_plugin"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'plugin')).'">'. + $menu['plugin']['prompt'].'</a></div></li>'); + unset($menu['plugin']); + + ptln(' <li class="admin_config"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'config')).'">'. + $menu['config']['prompt'].'</a></div></li>'); + unset($menu['config']); + } + ptln('</ul>'); + + // Manager Tasks + ptln('<ul class="admin_tasks">'); + + ptln(' <li class="admin_revert"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'revert')).'">'. + $menu['revert']['prompt'].'</a></div></li>'); + unset($menu['revert']); + + ptln(' <li class="admin_popularity"><div class="li">'. + '<a href="'.wl($ID, array('do' => 'admin','page' => 'popularity')).'">'. + $menu['popularity']['prompt'].'</a></div></li>'); + unset($menu['popularity']); + + ptln('</ul>'); + + + // print the rest as sorted list + if(count($menu)){ + usort($menu, 'p_sort_modes'); + // output the menu + ptln('<div class="clearer"></div>'); + print p_locale_xhtml('adminplugins'); + ptln('<ul>'); + foreach ($menu as $item) { + if (!$item['prompt']) continue; + ptln(' <li><div class="li"><a href="'.wl($ID, 'do=admin&page='.$item['plugin']).'">'.$item['prompt'].'</a></div></li>'); + } + ptln('</ul>'); + } } /** diff --git a/inc/lang/en/adminplugins.txt b/inc/lang/en/adminplugins.txt new file mode 100644 index 000000000..3ec46cf4e --- /dev/null +++ b/inc/lang/en/adminplugins.txt @@ -0,0 +1,2 @@ +===== Additional Plugins ===== + |