1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 18:47:54 +01:00

Remove empty main navigation sections (Admin navigation)

This commit is contained in:
SecretR 2013-02-13 14:52:35 +02:00
parent 5dfeaa018f
commit 7b92549560

View File

@ -1475,28 +1475,37 @@ class admin_shortcodes
// ---------------- Cameron's Bit ---------------------------------
if(!varsettrue($pref['admin_separate_plugins']))
if(!varsettrue($pref['admin_separate_plugins']))
{
// Convert Plugin Categories to Core Categories.
$convert = array(
'settings' => array(1,'setMenu'),
'users' => array(2,'userMenu'),
'content' => array(3,'contMenu'),
'tools' => array(4,'toolMenu'),
'manage' => array(6,'managMenu'),
'misc' => array(7,'miscMenu'),
'help' => array(20,'helpMenu')
);
foreach($tmp as $pg)
{
$id = $convert[$pg['category']][1];
$menu_vars[$id]['sub'][] = $pg;
}
unset($menu_vars['plugMenu']);
// Clean up - remove empty main sections
foreach ($menu_vars as $_m => $_d)
{
// Convert Plugin Categories to Core Categories.
$convert = array(
'settings' => array(1,'setMenu'),
'users' => array(2,'userMenu'),
'content' => array(3,'contMenu'),
'tools' => array(4,'toolMenu'),
'manage' => array(6,'managMenu'),
'misc' => array(7,'miscMenu'),
'help' => array(20,'helpMenu')
);
foreach($tmp as $pg)
{
$id = $convert[$pg['category']][1];
$menu_vars[$id]['sub'][] = $pg;
}
unset($menu_vars['plugMenu']);
if(!isset($_d['sub']) || empty($_d['sub']))
{
unset($menu_vars[$_m]);
}
}
}
// print_a($menu_vars);
// ------------------------------------------------------------------
//added option to disable leave/logout (ll) - more flexibility for theme developers