From c2d334624b1b8bb26d7ef0a49b10292a9e9f3f46 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Jan 2013 17:44:23 +0100 Subject: [PATCH] Qual: Simplify system for menu manager. Only one file, one class per manager. --- ChangeLog | 5 +- htdocs/admin/menus.php | 4 - htdocs/core/class/html.formadmin.class.php | 8 +- .../smartphone/smartphone_backoffice.php | 60 --------------- ...ne_frontoffice.php => smartphone_menu.php} | 38 ++++++---- .../menus/standard/auguria_backoffice.php | 74 ------------------- ...guria_frontoffice.php => auguria_menu.php} | 35 ++++----- .../core/menus/standard/eldy_frontoffice.php | 33 +++++---- .../{eldy_backoffice.php => eldy_menu.php} | 38 ++++++---- .../install/mysql/migration/3.3.0-3.4.0.sql | 8 ++ htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/main.inc.php | 19 +++-- 13 files changed, 111 insertions(+), 213 deletions(-) delete mode 100755 htdocs/core/menus/smartphone/smartphone_backoffice.php rename htdocs/core/menus/smartphone/{smartphone_frontoffice.php => smartphone_menu.php} (57%) delete mode 100644 htdocs/core/menus/standard/auguria_backoffice.php rename htdocs/core/menus/standard/{auguria_frontoffice.php => auguria_menu.php} (63%) rename htdocs/core/menus/standard/{eldy_backoffice.php => eldy_menu.php} (63%) diff --git a/ChangeLog b/ChangeLog index 46f482aeab9..8775d808037 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,9 +4,12 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3 ***** For users: -- New: Some performance enhancements +- New: Some performance enhancements. +- New: Can attach files onto trip and expenses modules. For developers: +- System of menu managers has been rewritten to reduce code to do same things. +- An external module can force its theme. For translators: diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 23eade151a1..e40af9b75dc 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -77,10 +77,6 @@ if ($action == 'update' && empty($_POST["cancel"])) // Define list of menu handlers to initialize $listofmenuhandler=array(); - $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1; - $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1; - if (isset($_POST["MAIN_MENU_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENU_SMARTPHONE"])]=1; - if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1; // Initialize menu handlers foreach ($listofmenuhandler as $key => $val) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index c60f1a81504..ccd3e038f74 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -121,7 +121,7 @@ class FormAdmin global $langs,$conf; // Clean parameters - if ($selected == 'eldy.php') $selected='eldy_backoffice.php'; // For compatibility + // Check parameters if (! is_array($dirmenuarray)) return -1; @@ -143,7 +143,11 @@ class FormAdmin if (is_file($dir."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && substr($file, 0, 5) != 'index') { if (preg_match('/lib\.php$/i',$file)) continue; // We exclude library files - $filelib=preg_replace('/\.php$/i','',$file); + if (preg_match('/eldy_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files + if (preg_match('/auguria_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files + if (preg_match('/smartphone_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files + + $filelib=preg_replace('/\.php$/i','',$file); $prefix=''; // 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other if (preg_match('/^eldy/i',$file)) $prefix='0'; diff --git a/htdocs/core/menus/smartphone/smartphone_backoffice.php b/htdocs/core/menus/smartphone/smartphone_backoffice.php deleted file mode 100755 index e0144c6913f..00000000000 --- a/htdocs/core/menus/smartphone/smartphone_backoffice.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Copyright (C) 2007-2010 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/menus/smartphone/smartphone_backoffice.php - * \brief Gestionnaire nomme smartphone du menu smartphone - */ - - -/** - * Class to manage smartphone menu smartphone (for internal users) - */ -class MenuSmart -{ - var $db; - var $atarget=""; // Valeur du target a utiliser dans les liens - - - /** - * Constructor - * - * @param DoliDb $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * Show menu - * - * @param string $limitmenuto To limit menu to a top or left menu value - * @return void - */ - function showmenu($limitmenuto) - { - require_once DOL_DOCUMENT_ROOT.'/core/menus/smartphone/smartphone.lib.php'; - - print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$limitmenuto); - } - -} - -?> \ No newline at end of file diff --git a/htdocs/core/menus/smartphone/smartphone_frontoffice.php b/htdocs/core/menus/smartphone/smartphone_menu.php similarity index 57% rename from htdocs/core/menus/smartphone/smartphone_frontoffice.php rename to htdocs/core/menus/smartphone/smartphone_menu.php index 9120537fa5b..e95bdc1df09 100755 --- a/htdocs/core/menus/smartphone/smartphone_frontoffice.php +++ b/htdocs/core/menus/smartphone/smartphone_menu.php @@ -17,45 +17,57 @@ */ /** - * \file htdocs/core/menus/smartphone/smartphone_frontoffice.php - * \brief Gestionnaire nomme smartphone du menu smartphone + * \file htdocs/core/menus/smartphone/smartphone_menu.php + * \brief Menu smartphone manager */ /** - * Class to manage smartphone menu smartphone (for external users) + * Class to manage smartphone menu smartphone */ class MenuSmart { var $hideifnotallowed=1; // Put 0 for back office menu, 1 for front office menu var $atarget=""; // Valeur du target a utiliser dans les liens - + var $name="smartphone"; + /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param int $type_user Type of user */ - function __construct($db) + function __construct($db, $type_user) { $this->db=$db; } /** - * Show menu + * Show menu * - * @param string $limitmenuto To limit menu to a top or left menu value - * @return void + * @param string $mode 'top' or 'left' + * @return int Number of menu entries shown */ - function showmenu($limitmenuto) + function showmenu($mode) { - require_once DOL_DOCUMENT_ROOT.'/core/menus/smartphone/smartphone.lib.php'; + global $conf; + + require_once DOL_DOCUMENT_ROOT.'/core/menus/smartphone/smartphone.lib.php'; - print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$limitmenuto); + if ($this->type_user == 1) + { + $conf->global->MAIN_SEARCHFORM_SOCIETE=0; + $conf->global->MAIN_SEARCHFORM_CONTACT=0; + } + + print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$mode); + + return 1; } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/menus/standard/auguria_backoffice.php b/htdocs/core/menus/standard/auguria_backoffice.php deleted file mode 100644 index a22c40ed315..00000000000 --- a/htdocs/core/menus/standard/auguria_backoffice.php +++ /dev/null @@ -1,74 +0,0 @@ - - * Copyright (C) 2009 Regis Houssin - * Copyright (C) 2008-2013 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/menus/standard/auguria_backoffice.php - * \brief Gestionnaire nomme Auguria du menu du haut - * - * \remarks La construction d'un gestionnaire pour le menu du haut est simple: - * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - * \remarks doivent etre affichees par ... - * \remarks ou si menu selectionne ... - */ - - -/** - * Classe permettant la gestion du menu du haut Auguria - */ -class MenuManager -{ - var $db; - var $type_user=0; // Put 0 for internal users, 1 for external users - var $atarget=""; // Valeur du target a utiliser dans les liens - - var $menu_array; - var $menu_array_after; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * Show menu - * - * @param string $mode 'top' or 'left' - * @return int Number of menu entries shown - */ - function showmenu($mode) - { - require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php'; - - $res='ErrorBadParameterForMode'; - if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user); - if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after); - - return $res; - } - -} - -?> diff --git a/htdocs/core/menus/standard/auguria_frontoffice.php b/htdocs/core/menus/standard/auguria_menu.php similarity index 63% rename from htdocs/core/menus/standard/auguria_frontoffice.php rename to htdocs/core/menus/standard/auguria_menu.php index cb8299feee3..251a205290e 100644 --- a/htdocs/core/menus/standard/auguria_frontoffice.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -18,25 +18,21 @@ */ /** - * \file htdocs/core/menus/standard/auguria_frontoffice.php - * \brief Gestionnaire nomme Auguria du menu du haut - * - * \remarks La construction d'un gestionnaire pour le menu du haut est simple: - * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - * \remarks doivent etre affichees par ... - * \remarks ou si menu selectionne ... + * \file htdocs/core/menus/standard/auguria_menu.php + * \brief Menu auguria manager */ /** - * Classe permettant la gestion du menu du haut Auguria + * Class to manage menu Auguria */ class MenuManager { var $db; - var $type_user=1; // Put 0 for internal users, 1 for external users - var $atarget=""; // Valeur du target a utiliser dans les liens - + var $type_user; // Put 0 for internal users, 1 for external users + var $atarget=""; // Valeur du target a utiliser dans les liens + var $name="auguria"; + var $menu_array; var $menu_array_after; @@ -44,11 +40,13 @@ class MenuManager /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param int $type_user Type of user */ - function __construct($db) + function __construct($db, $type_user) { - $this->db=$db; + $this->type_user=$type_user; + $this->db=$db; } @@ -64,9 +62,12 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php'; - $conf->global->MAIN_SEARCHFORM_SOCIETE=0; - $conf->global->MAIN_SEARCHFORM_CONTACT=0; - + if ($this->type_user == 1) + { + $conf->global->MAIN_SEARCHFORM_SOCIETE=0; + $conf->global->MAIN_SEARCHFORM_CONTACT=0; + } + $res='ErrorBadParameterForMode'; if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user); if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after); diff --git a/htdocs/core/menus/standard/eldy_frontoffice.php b/htdocs/core/menus/standard/eldy_frontoffice.php index 2221e0ec9f0..2d6d11f28dc 100644 --- a/htdocs/core/menus/standard/eldy_frontoffice.php +++ b/htdocs/core/menus/standard/eldy_frontoffice.php @@ -17,25 +17,21 @@ */ /** - * \file htdocs/core/menus/standard/eldy_frontoffice.php - * \brief Gestionnaire nomme eldy du menu du haut - * - * \remarks La construction d'un gestionnaire pour le menu du haut est simple: - * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - * \remarks doivent etre affichees par ... - * \remarks ou si menu selectionne ... + * \file htdocs/core/menus/standard/eldy_menu.php + * \brief Menu eldy manager */ /** - * Class to manage menu Eldy (for external users) + * Class to manage menu Eldy */ class MenuManager { var $db; - var $type_user=1; // Put 0 for internal users, 1 for external users + var $type_user; // Put 0 for internal users, 1 for external users var $atarget=""; // Valeur du target a utiliser dans les liens - + var $name="eldy"; + var $menu_array; var $menu_array_after; @@ -43,10 +39,12 @@ class MenuManager /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param int $type_user Type of user */ - function __construct($db) + function __construct($db, $type_user) { + $this->type_user=$type_user; $this->db=$db; } @@ -54,8 +52,8 @@ class MenuManager /** * Show menu * - * @param string $mode 'top' or 'left' - * @return int Number of menu entries shown + * @param string $mode 'top' or 'left' + * @return int Number of menu entries shown */ function showmenu($mode) { @@ -63,8 +61,11 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; - $conf->global->MAIN_SEARCHFORM_SOCIETE=0; - $conf->global->MAIN_SEARCHFORM_CONTACT=0; + if ($this->type_user == 1) + { + $conf->global->MAIN_SEARCHFORM_SOCIETE=0; + $conf->global->MAIN_SEARCHFORM_CONTACT=0; + } $res='ErrorBadParameterForMode'; if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user); diff --git a/htdocs/core/menus/standard/eldy_backoffice.php b/htdocs/core/menus/standard/eldy_menu.php similarity index 63% rename from htdocs/core/menus/standard/eldy_backoffice.php rename to htdocs/core/menus/standard/eldy_menu.php index 638fd45664d..2d6d11f28dc 100644 --- a/htdocs/core/menus/standard/eldy_backoffice.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007-2010 Regis Houssin + * Copyright (C) 2007-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,25 +17,21 @@ */ /** - * \file htdocs/core/menus/standard/eldy_backoffice.php - * \brief Gestionnaire nomme eldy du menu du haut - * - * \remarks La construction d'un gestionnaire pour le menu du haut est simple: - * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - * \remarks doivent etre affichees par ... - * \remarks ou si menu selectionne ... + * \file htdocs/core/menus/standard/eldy_menu.php + * \brief Menu eldy manager */ /** - * Classe to manage menu Eldy + * Class to manage menu Eldy */ class MenuManager { var $db; - var $type_user=0; // Put 0 for internal users, 1 for external users + var $type_user; // Put 0 for internal users, 1 for external users var $atarget=""; // Valeur du target a utiliser dans les liens - + var $name="eldy"; + var $menu_array; var $menu_array_after; @@ -43,10 +39,12 @@ class MenuManager /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param int $type_user Type of user */ - function __construct($db) + function __construct($db, $type_user) { + $this->type_user=$type_user; $this->db=$db; } @@ -54,17 +52,25 @@ class MenuManager /** * Show menu * - * @param string $mode 'top' or 'left' - * @return int Number of menu entries shown + * @param string $mode 'top' or 'left' + * @return int Number of menu entries shown */ function showmenu($mode) { + global $conf; + require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; + if ($this->type_user == 1) + { + $conf->global->MAIN_SEARCHFORM_SOCIETE=0; + $conf->global->MAIN_SEARCHFORM_CONTACT=0; + } + $res='ErrorBadParameterForMode'; if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user); if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after); - + return $res; } diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 4827eafb60b..fd779495e3e 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -23,3 +23,11 @@ create table llx_adherent_type_extrafields import_key varchar(14) -- import key ) ENGINE=innodb; ALTER TABLE llx_adherent_type_extrafields ADD INDEX idx_adherent_type_extrafields (fk_object); + +UPDATE llx_const set value='eldy_menu.php' where value='eldy_backoffice.php'; +UPDATE llx_const set value='eldy_menu.php' where value='eldy_frontoffice.php'; +UPDATE llx_const set value='auguria_menu.php' where value='auguria_backoffice.php'; +UPDATE llx_const set value='auguria_menu.php' where value='auguria_frontoffice.php'; +UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_backoffice.php'; +UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_frontoffice.php'; + diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c8430c95cac..bb10a493384 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -565,6 +565,7 @@ ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP NoFileFound=No documents saved in this directory CurrentUserLanguage=Current language CurrentTheme=Current theme +CurrentMenuManager=current men manager DisabledModules=Disabled modules For=For ForCustomer=For customer diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 80e4493ff84..52c7b339ffe 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -568,6 +568,7 @@ ThisLimitIsDefinedInSetup=Limite Dolibarr (Menu accueil-configuration-sécurité NoFileFound=Pas de documents stockés dans cette rubrique CurrentUserLanguage=Langue utilisateur actuelle CurrentTheme=Thème courant +CurrentMenuManager=Gestionnaire de menu courant DisabledModules=Modules désactivés For=Pour ForCustomer=Pour le client diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d464083167b..58f1ac48d02 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -778,21 +778,18 @@ if (! empty($conf->multicompany->enabled) && GETPOST('action') == 'switchentity' // Init menu manager if (empty($user->societe_id)) // If internal user or not defined { - $conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED); - $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_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); + $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED); } else // If external user { - $conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED); - $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED); + $conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED); + $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED); } -// For backward compatibility -if (empty($conf->standard_menu)) $conf->standard_menu ='eldy_backoffice.php'; -elseif ($conf->standard_menu == 'eldy.php') $conf->standard_menu='eldy_backoffice.php'; // Load the menu manager (only if not already done) $file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu; -if (GETPOST('menu')) $file_menu=GETPOST('menu'); // menu=eldy_backoffice.php +if (GETPOST('menu')) $file_menu=GETPOST('menu'); // example: menu=eldy_menu.php if (! class_exists('MenuManager')) { $menufound=0; @@ -804,11 +801,12 @@ if (! class_exists('MenuManager')) } if (! $menufound) // If failed to include, we try with standard { - $file_menu='eldy_backoffice.php'; + dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING); + $file_menu='eldy_menu.php'; include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu; } } -$menumanager = new MenuManager($db); +$menumanager = new MenuManager($db, empty($user->societe_id)?0:1); @@ -1337,6 +1335,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $loginhtmltext.='
'.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin,"dayhour"); $loginhtmltext.='
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"]; $loginhtmltext.='
'.$langs->trans("CurrentTheme").': '.$conf->theme; + $loginhtmltext.='
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; $s=picto_from_langcode($langs->getDefaultLang()); $loginhtmltext.='
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';