From 4e1dbf8b07973ae0c9065d760a992d52bb8f13ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jul 2024 21:18:53 +0200 Subject: [PATCH] Work on MAIN_MENU_LEFT_DROPDOWN --- htdocs/core/menus/standard/eldy_menu.php | 6 +++++- htdocs/main.inc.php | 15 ++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 56094843f25..40cb9f0d427 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -137,7 +137,7 @@ class MenuManager * Show menu. * Menu defined in sql tables were stored into $this->tabMenu BEFORE this is called. * - * @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu) + * @param string $mode 'top', 'topnb', 'left', 'leftdropdown', 'jmobile' (used to get full xml ul/li menu) * @param array $moredata An array with more data to output * @return int 0 or nb of top menu entries if $mode = 'topnb' */ @@ -162,6 +162,10 @@ class MenuManager if ($mode == 'left') { print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata, $this->type_user); } + if ($mode == 'leftdropdown') { + //$leftmenudropdown = print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata, $this->type_user); + $leftmenudropdown = print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 1, '', '', $moredata, $this->type_user); + } } else { $conf->global->MAIN_SHOW_LOGO = 0; if ($mode == 'top') { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d2aa8f02026..8e331e566c8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1521,10 +1521,10 @@ $heightforframes = 50; // Init menu manager if (!defined('NOREQUIREMENU')) { if (empty($user->socid)) { // If internal user or not defined - $conf->standard_menu = (!getDolGlobalString('MAIN_MENU_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENU_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED); + $conf->standard_menu = getDolGlobalString('MAIN_MENU_STANDARD_FORCED', getDolGlobalString('MAIN_MENU_STANDARD', 'eldy_menu.php')); } else { // If external user - $conf->standard_menu = (!getDolGlobalString('MAIN_MENUFRONT_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENUFRONT_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED); + $conf->standard_menu = getDolGlobalString('MAIN_MENUFRONT_STANDARD_FORCED', getDolGlobalString('MAIN_MENUFRONT_STANDARD', 'eldy_menu.php')); } // Load the menu manager (only if not already done) @@ -1633,7 +1633,7 @@ if (!function_exists("llxHeader")) { } if (empty($conf->dol_hide_leftmenu) && !GETPOST('dol_openinpopup', 'aZ09')) { - left_menu(array(), $help_url, '', '', 1, $title, 1); // $menumanager is retrieved with a global $menumanager inside this function + left_menu(array(), $help_url, '', array(), 1, $title, 1); // $menumanager is retrieved with a global $menumanager inside this function } // main area @@ -1641,6 +1641,7 @@ if (!function_exists("llxHeader")) { print $replacemainareaby; return; } + main_area($title); } } @@ -3104,7 +3105,7 @@ function top_menu_bookmark() */ function top_menu_search() { - global $langs, $conf, $db, $user, $hookmanager; + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php $html = ''; @@ -3385,7 +3386,11 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ // Show left menu with other forms $menumanager->menu_array = $menu_array_before; $menumanager->menu_array_after = $menu_array_after; - $menumanager->showmenu('left', array('searchform' => $searchform)); // output menu_array and menu found in database + if (getDolGlobalInt('MAIN_MENU_LEFT_DROPDOWN')) { + $menumanager->showmenu('leftdropdown', array('searchform' => $searchform)); // output menu_array and menu found in database + } else { + $menumanager->showmenu('left', array('searchform' => $searchform)); // output menu_array and menu found in database + } // Dolibarr version + help + bug report link print "\n";