Add color blind option in body for css impact

This commit is contained in:
John Botella 2019-08-07 12:15:55 +02:00
parent 63191dab7d
commit 401dc12b93
3 changed files with 10 additions and 3 deletions

View File

@ -96,7 +96,7 @@ class DolGraph
*/
public function __construct($library = 'jflot')
{
global $conf, $user;
global $conf;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
// To use old feature

View File

@ -902,6 +902,9 @@ elseif (! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER))
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=$user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
}
// set MAIN_OPTIMIZEFORCOLORBLIND
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND=$user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu', 'int') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
if (GETPOST('dol_hide_topmenu', 'int') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
@ -1087,6 +1090,10 @@ if (! function_exists("llxHeader"))
if ($mainmenu != 'website') $tmpcsstouse=$morecssonbody; // We do not use sidebar-collpase by default to have menuhider open by default.
}
if(!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)){
$tmpcsstouse.= ' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
}
print '<body id="mainbody" class="'.$tmpcsstouse.'">' . "\n";
// top menu and left menu area

View File

@ -30,10 +30,10 @@
* if (is_readable($var_file)) include $var_file;
*/
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet, $user;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224);
$theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250,190,30), array(221, 75, 57), array(0,166,90), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
if(!empty($user) && !empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by graph
if(!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) // user is loaded by dolgraph.class.php
{
// for now we use the same configuration for all types of color blind
$theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(120,120,120), array(253, 205, 102), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));