From 5231fbf1e3519c3cb1d7caf704b25b20a67a6a1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Mar 2017 11:37:03 +0100 Subject: [PATCH] Option to hide version --- htdocs/main.inc.php | 60 +++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5cb73be28e7..6b9d4f08531 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1390,7 +1390,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logouttext=''; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $logouthtmltext=$appli.'
'; + //$logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { $logouthtmltext.=$langs->trans("Logout").'
'; @@ -1467,8 +1467,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if ($helpbaseurl && $helppage) { $text=''; - $title=''; - //$text.='
'; + $title=$appli.'
'; $title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage'); if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"'; $text.=''."\n"; // Version - $doliurl='http://www.dolibarr.org'; - //local communities - if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr'; - if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es'; - if (preg_match('/de/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.de'; - if (preg_match('/it/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.it'; - if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.gr'; - - $appli=constant('DOL_APPLICATION_TITLE'); - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) - { - $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; - if (preg_match('/\d\.\d/', $appli)) - { - if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli.=" ".DOL_VERSION; - } - else $appli.=" ".DOL_VERSION; - print ''."\n"; + if (empty($conf->global->MAIN_HIDE_VERSION)) // Version is already on help picto and on login page. + { + $doliurl='https://www.dolibarr.org'; + //local communities + if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr'; + if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es'; + if (preg_match('/de/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.de'; + if (preg_match('/it/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.it'; + if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.gr'; + + $appli=constant('DOL_APPLICATION_TITLE'); + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { + $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; + if (preg_match('/\d\.\d/', $appli)) + { + if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; + print '
'; + if ($doliurl) print ''; + else print ''; + print $appli; + if ($doliurl) print ''; + else print ''; + print '
'."\n"; + } // Link to bugtrack if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK))