diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php
index afb0323304e..11b85567a41 100644
--- a/htdocs/blockedlog/lib/blockedlog.lib.php
+++ b/htdocs/blockedlog/lib/blockedlog.lib.php
@@ -46,7 +46,7 @@ function blockedlogadmin_prepare_head()
$b = new BlockedLog($db);
if ($b->alreadyUsed())
{
- $head[$h][1] .= '...';
+ $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '...' : '');
}
$head[$h][2] = 'fingerprints';
$h++;
diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php
index 4d5f980de83..1eb5fc52a5b 100644
--- a/htdocs/bom/lib/bom.lib.php
+++ b/htdocs/bom/lib/bom.lib.php
@@ -90,7 +90,7 @@ function bomPrepareHead($object)
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : '');
$head[$h][2] = 'note';
$h++;
}
@@ -102,7 +102,7 @@ function bomPrepareHead($object)
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).'';
+ if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles + $nbLinks).'' : '');
$head[$h][2] = 'document';
$h++;
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index b78c0478370..adb1201df1d 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -663,7 +663,7 @@ function security_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/admin/perms.php";
$head[$h][1] = $langs->trans("DefaultRights");
- if ($nbPerms > 0) $head[$h][1] .= ''.$nbPerms.'';
+ if ($nbPerms > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbPerms.'' : '');
$head[$h][2] = 'default';
$h++;
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 5d450aa4b04..6eff2772014 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -481,7 +481,7 @@ function actions_prepare_head($object)
$listofresourcelinked = $resource->getElementResources($object->element, $object->id);
$nbResources = (is_array($listofresourcelinked) ?count($listofresourcelinked) : 0);
$head[$h][1] = $langs->trans("Resources");
- if ($nbResources > 0) $head[$h][1] .= ''.($nbResources).'';
+ if ($nbResources > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbResources).'' : '');
$head[$h][2] = 'resources';
$h++;
}
@@ -494,7 +494,7 @@ function actions_prepare_head($object)
$nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents");
- if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).'';
+ if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles + $nbLinks).'' : '');
$head[$h][2] = 'documents';
$h++;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 169d979cc8b..9cecd9e3be6 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1216,7 +1216,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
{
$limittitle = 30;
$out .= '';
- if ($picto) $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
+ if ($picto && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
$out .= ''.dol_trunc($title, $limittitle).'';
$out .= '';
}
@@ -2246,6 +2246,8 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
$newemail = $email;
+ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) $withpicto = 0;
+
if (empty($email)) return ' ';
if (!empty($addlink))
@@ -2279,7 +2281,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
}
//$rep = '
';
- $rep = ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail;
+ $rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail;
//$rep .= '
';
if ($hookmanager) {
$parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 9ac9383e516..0b07e96ab50 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -64,7 +64,7 @@ function user_prepare_head($object)
if ($canreadperms)
{
$head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id;
- $head[$h][1] = $langs->trans("Rights").''.($object->nb_rights).'';
+ $head[$h][1] = $langs->trans("Rights").(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($object->nb_rights).'' : '');
$head[$h][2] = 'rights';
$h++;
}
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index 97bece99852..e10c311cf05 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -54,6 +54,7 @@ $titleofloginpage = $langs->trans('Login').' @ '.$titletruedolibarrversion; // $
$disablenofollow = 1;
if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenofollow = 0;
+if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $disablenofollow = 0;
print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 679e565cf0e..cf53d994ece 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -257,6 +257,12 @@ if (isset($_SERVER["HTTP_USER_AGENT"]))
if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1;
}
+// Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part)
+if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks')) // If we must enable text browser
+{
+ $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1;
+}
+
// Force HTTPS if required ($conf->file->main_force_https is 0/1 or 'https dolibarr root url')
// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off'
if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on'))
@@ -343,7 +349,6 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE
}
}
-
// Creation of a token against CSRF vulnerabilities
if (!defined('NOTOKENRENEWAL'))
{
@@ -868,7 +873,6 @@ if (GETPOST('theme', 'alpha'))
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
-
// Set javascript option
if (!GETPOST('nojs', 'int')) // If javascript was not disabled on URL
{
@@ -876,19 +880,14 @@ if (!GETPOST('nojs', 'int')) // If javascript was not disabled on URL
{
$conf->use_javascript_ajax = !$user->conf->MAIN_DISABLE_JAVASCRIPT;
}
-}
-else $conf->use_javascript_ajax = 0;
-// Set MAIN_OPTIMIZEFORTEXTBROWSER
-if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks') || !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) // If we must enable text browser
-{
- $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1;
-}
-elseif (!empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER))
-{
+} else $conf->use_javascript_ajax = 0;
+
+// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part)
+if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
}
-// set MAIN_OPTIMIZEFORCOLORBLIND
+// set MAIN_OPTIMIZEFORCOLORBLIND for user
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// Set terminal output option according to conf->browser.
diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
index bd574e837db..ebd5b837e3d 100644
--- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
+++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
@@ -48,7 +48,7 @@ function myobjectPrepareHead($object)
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1] .= ''.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : '');
$head[$h][2] = 'note';
$h++;
}
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index ce7e4e1b949..8193cf78934 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -714,6 +714,8 @@ class Entrepot extends CommonObject
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
+ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) $withpicto = 0;
+
$result = '';
$label = ''.$langs->trans("Warehouse").'';
diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php
index ae02a8e7f73..d2a59447bb9 100644
--- a/htdocs/theme/eldy/badges.inc.php
+++ b/htdocs/theme/eldy/badges.inc.php
@@ -1,5 +1,6 @@
+if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet');
+?>
/* Badge style is based on boostrap framework */
.badge {
diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php
index e0538e73a99..bf229dd650d 100644
--- a/htdocs/website/lib/websiteaccount.lib.php
+++ b/htdocs/website/lib/websiteaccount.lib.php
@@ -46,7 +46,7 @@ function websiteaccountPrepareHead($object)
if(!empty($object->fields['note_public'])) $nbNote++;
$head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
- if ($nbNote > 0) $head[$h][1].= ''.$nbNote.'';
+ if ($nbNote > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : '');
$head[$h][2] = 'note';
$h++;
}*/
@@ -59,7 +59,7 @@ function websiteaccountPrepareHead($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
- if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).'';
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles+$nbLinks).'' : '');
$head[$h][2] = 'document';
$h++;