From 81c80b254ea6d43ba280fed993a901391a20b542 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Jun 2020 19:25:25 +0200 Subject: [PATCH] Fix lang property on database menu entry was not propagated --- htdocs/core/class/menu.class.php | 4 ++-- htdocs/core/class/menubase.class.php | 1 + htdocs/core/menus/standard/eldy.lib.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 040cb4a3552..60bf6474031 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -52,7 +52,7 @@ class Menu * Add a menu entry into this->liste (at end) * * @param string $url Url to follow on click (does not include DOL_URL_ROOT) - * @param string $titre Label of menu to add + * @param string $titre Label of menu to add. The value must already be translated. * @param integer $level Level of menu to add * @param int $enabled Menu active or not (0=Not active, 1=Active, 2=Active but grey) * @param string $target Target link @@ -75,7 +75,7 @@ class Menu * * @param int $idafter Array key after which inserting new entry * @param string $url Url to follow on click - * @param string $titre Label of menu to add + * @param string $titre Label of menu to add. The value must already be translated. * @param integer $level Level of menu to add * @param int $enabled Menu active or not * @param string $target Target link diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 72ff932bfa6..b73492d41fb 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -725,6 +725,7 @@ class Menubase $tabMenu[$b]['mainmenu'] = $menu['mainmenu']; $tabMenu[$b]['leftmenu'] = $menu['leftmenu']; $tabMenu[$b]['perms'] = $perms; + $tabMenu[$b]['langs'] = $menu['langs']; $tabMenu[$b]['enabled'] = $enabled; $tabMenu[$b]['type'] = $menu['type']; //$tabMenu[$b]['langs'] = $menu['langs']; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 661eded1b33..cc47218e2db 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param DoliDB $db Database handler * @param string $atarget Target (Example: '' or '_top') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty). For eldy menu, it contains menu entries loaded from database. * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout 1=Disable output (Initialise &$menu only). * @param string $mode 'top', 'topnb', 'left', 'jmobile' @@ -49,6 +49,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $mainmenu = (empty($_SESSION["mainmenu"]) ? '' : $_SESSION["mainmenu"]); $leftmenu = (empty($_SESSION["leftmenu"]) ? '' : $_SESSION["leftmenu"]); + $id = 'mainmenu'; $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);