diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 67708eba5fe..2fc166e7625 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 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 $menu Object Menu to return back list of menu entries
- * @param int $noout Disable output (Initialise &$menu only).
+ * @param int $noout 1=Disable output (Initialise &$menu only).
* @return int 0
*/
function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
@@ -50,6 +50,19 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
if (empty($noout)) print_start_menu_array();
+ // Show/Hide vertical menu
+ if (GETPOST('testhidemenu') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ {
+ $showmode=1;
+ $classname = 'class="tmenu"';
+ $idsel='home';
+
+ if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
+ if (empty($noout)) print_text_menu_entry($langs->trans("XXX"), 1, '#', $id, $idsel, $classname, $atarget);
+ if (empty($noout)) print_end_menu_entry($showmode);
+ $menu->add('#', $langs->trans("XXX"), 0, $showmode, $atarget, "xxx", '');
+ }
+
// Home
$showmode=1;
$classname="";
@@ -463,7 +476,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
print ''."\n";
}
- if (is_array($moredata) && ! empty($moredata['searchform']))
+ if (is_array($moredata) && ! empty($moredata['searchform']) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
print "\n";
print "\n";
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index 354f7de1453..eb5e75dfef8 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -144,7 +144,7 @@ class MenuManager
if ($mode == 'topnb')
{
- print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
+ print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); // no output
return $this->menu->getNbOfVisibleMenuEntries();
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b17ce86ad17..ffdb4288928 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -563,7 +563,11 @@ if (! defined('NOLOGIN'))
$reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
- header('Location: '.DOL_URL_ROOT.'/index.php');
+ $paramsurl=array();
+ if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
+ if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
+ if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha');
+ header('Location: '.DOL_URL_ROOT.'/index.php'.($count(paramsurl)?'?'.join('&',$paramsurl):''));
exit;
}
}
@@ -617,7 +621,11 @@ if (! defined('NOLOGIN'))
$reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
- header('Location: '.DOL_URL_ROOT.'/index.php');
+ $paramsurl=array();
+ if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int');
+ if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int');
+ if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha');
+ header('Location: '.DOL_URL_ROOT.'/index.php'.($count(paramsurl)?'?'.join('&',$paramsurl):''));
exit;
}
else
@@ -756,6 +764,11 @@ if (! GETPOST('nojs')) // If javascript was not disabled on URL
}
}
else $conf->use_javascript_ajax=0;
+// Set MAIN_OPTIMIZEFORTEXTBROWSER
+if (GETPOST('textbrowser') || ! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) // If text browser was enabled on URL
+{
+ $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=1;
+}
// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
@@ -1006,9 +1019,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
$favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n";
+ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n";
// Displays title
$appli=constant('DOL_APPLICATION_TITLE');
@@ -1460,7 +1473,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
else $toprightmenu.=$result; // For backward compatibility
// Link to print main content area
- if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone))
+ if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone))
{
$qs=$_SERVER["QUERY_STRING"];
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
@@ -1471,7 +1484,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
}
// Link to Dolibarr wiki pages
- if (empty($conf->global->MAIN_HELP_DISABLELINK))
+ if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$langs->load("help");