Fix: Do not load menu when not required.

This commit is contained in:
Laurent Destailleur 2013-02-24 03:45:19 +01:00
parent 50de5a944a
commit 08bde6faa5
2 changed files with 32 additions and 31 deletions

View File

@ -494,7 +494,7 @@ class Menubase
/** /**
* Load entries found in database into variable $tabMenu. Note that only "database menu entries" are loaded here, hardcoded will not be present into output. * Load entries found in database into variable $tabMenu. Note that only "database menu entries" are loaded here, hardcoded will not be present into output.
* *
* @param string $mymainmenu Value for left that defined mainmenu * @param string $mymainmenu Value for mainmenu that defined mainmenu
* @param string $myleftmenu Value for left that defined leftmenu * @param string $myleftmenu Value for left that defined leftmenu
* @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users
* @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...)

View File

@ -768,9 +768,10 @@ if (! empty($conf->multicompany->enabled) && GETPOST('action') == 'switchentity'
} }
} }
//print 'eee'.$conf->standard_menu;
// Init menu manager // Init menu manager
if (! defined('NOREQUIREMENU'))
{
if (empty($user->societe_id)) // If internal user or not defined if (empty($user->societe_id)) // If internal user or not defined
{ {
$conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED); $conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
@ -802,7 +803,7 @@ if (! class_exists('MenuManager'))
} }
} }
$menumanager = new MenuManager($db, empty($user->societe_id)?0:1); $menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
}