32if (!defined(
'NOREQUIRESOC')) {
33 define(
'NOREQUIRESOC',
'1');
36if (!defined(
'NOCSRFCHECK')) {
37 define(
'NOCSRFCHECK', 1);
39if (!defined(
'NOTOKENRENEWAL')) {
40 define(
'NOTOKENRENEWAL', 1);
42if (!defined(
'NOLOGIN')) {
46if (!defined(
'NOREQUIREHTML')) {
47 define(
'NOREQUIREHTML', 1);
49if (!defined(
'NOREQUIREAJAX')) {
50 define(
'NOREQUIREAJAX',
'1');
54define(
'ISLOADEDBYSTEELSHEET',
'1');
57require __DIR__.
'/theme_vars.inc.php';
58if (defined(
'THEME_ONLY_CONSTANT')) {
63@phan-var-force string $badgeWarning
64@phan-var-force string $butactionbg
65@phan-var-force string $colorbackbody
66@phan-var-force string $colorbackhmenu1
67@phan-var-force string $colorbacklinebreak
68@phan-var-force string $colorbacklineimpair1
69@phan-var-force string $colorbacklineimpair2
70@phan-var-force string $colorbacklinepair1
71@phan-var-force string $colorbacklinepair2
72@phan-var-force string $colorbacklinepairchecked
73@phan-var-force string $colorbacklinepairhover
74@phan-var-force string $colorbacktabactive
75@phan-var-force string $colorbacktabcard1
76@phan-var-force string $colorbacktitle1
77@phan-var-force string $colorbackvmenu1
78@phan-var-force string $colorblind_deuteranopes_textSuccess
79@phan-var-force string $colorblind_deuteranopes_textWarning
80@phan-var-force string $colortext
81@phan-var-force string $colortextlink
82@phan-var-force string $colortexttitle
83@phan-var-force string $colortexttitlelink
84@phan-var-force string $colortexttitlenotab
85@phan-var-force string $colortexttitlenotab2
86@phan-var-force string $colortopbordertitle1
87@phan-var-force string $fontsize
88@phan-var-force string $textDanger
89@phan-var-force string $textSuccess
90@phan-var-force string $textWarning
91@phan-var-force string $textbutaction
92@phan-var-force string $toolTipBgColor
93@phan-var-force string $toolTipFontColor
94@phan-var-force string $topMenuFontSize
98session_cache_limiter(
'public');
100require_once __DIR__.
'/../../main.inc.php';
101require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
105if (empty($user->id) && !empty($_SESSION[
'dol_login'])) {
106 $user->fetch(0, $_SESSION[
'dol_login'],
'', 1);
111 $menumanager =
new MenuManager($db, empty($user->socid) ? 0 : 1);
120if (empty($dolibarr_nocache)) {
121 header(
'Cache-Control: max-age=10800, public, must-revalidate');
123 header(
'Cache-Control: no-cache');
127 $conf->theme =
GETPOST(
'theme',
'aZ09');
130 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
132if (GETPOSTISSET(
'THEME_DARKMODEENABLED')) {
133 $conf->global->THEME_DARKMODEENABLED =
GETPOSTINT(
'THEME_DARKMODEENABLED');
136$langs->load(
"main", 0, 1);
137$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
138$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
152$fontlist =
'arial,tahoma,verdana,helvetica';
158$img_button =
dol_buildpath($path.
'/theme/'.$theme.
'/img/button_bg.png', 1);
159$dol_hide_topmenu = $conf->dol_hide_topmenu;
160$dol_hide_leftmenu = $conf->dol_hide_leftmenu;
161$dol_optimize_smallscreen = $conf->dol_optimize_smallscreen;
162$dol_no_mouse_hover = $conf->dol_no_mouse_hover;
173if (!isset($conf->global->THEME_ELDY_BACKBODY)) {
174 $conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
176if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
177 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
179if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) {
180 $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
182if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) {
183 $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
185if (!isset($conf->global->THEME_ELDY_USE_HOVER)) {
186 $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
188if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) {
189 $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
191if (!isset($conf->global->THEME_ELDY_LINEBREAK)) {
192 $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
194if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) {
195 $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
197if (!isset($conf->global->THEME_ELDY_TEXTLINK)) {
198 $conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
200if (!isset($conf->global->THEME_ELDY_BTNACTION)) {
201 $conf->global->THEME_ELDY_BTNACTION = $butactionbg;
203if (!isset($conf->global->THEME_ELDY_TEXTBTNACTION)) {
204 $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction;
208 $conf->global->THEME_ELDY_BACKTABCARD1 =
'255,255,255';
209 $conf->global->THEME_ELDY_BACKTABACTIVE =
'234,234,234';
210 $conf->global->THEME_ELDY_TEXT =
'0,0,0';
211 $conf->global->THEME_ELDY_FONT_SIZE1 = $fontsize;
212 $conf->global->THEME_ELDY_FONT_SIZE2 =
'0.75em';
216$colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_BACKBODY') ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->
conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->
conf->THEME_ELDY_BACKBODY);
217$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TOPMENU_BACK1') ? $colorbackhmenu1 : $conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->
conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->
conf->THEME_ELDY_TOPMENU_BACK1);
218$colorbackvmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_VERMENU_BACK1') ? $colorbackvmenu1 : $conf->global->THEME_ELDY_VERMENU_BACK1) : (empty($user->
conf->THEME_ELDY_VERMENU_BACK1) ? $colorbackvmenu1 : $user->
conf->THEME_ELDY_VERMENU_BACK1);
219$colortopbordertitle1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TOPBORDER_TITLE1') ? $colortopbordertitle1 : $conf->global->THEME_ELDY_TOPBORDER_TITLE1) : (empty($user->
conf->THEME_ELDY_TOPBORDER_TITLE1) ? $colortopbordertitle1 : $user->
conf->THEME_ELDY_TOPBORDER_TITLE1);
220$colorbacktitle1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_BACKTITLE1') ? $colorbacktitle1 : $conf->global->THEME_ELDY_BACKTITLE1) : (empty($user->
conf->THEME_ELDY_BACKTITLE1) ? $colorbacktitle1 : $user->
conf->THEME_ELDY_BACKTITLE1);
221$colorbacktabcard1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_BACKTABCARD1') ? $colorbacktabcard1 : $conf->global->THEME_ELDY_BACKTABCARD1) : (empty($user->
conf->THEME_ELDY_BACKTABCARD1) ? $colorbacktabcard1 : $user->
conf->THEME_ELDY_BACKTABCARD1);
222$colorbacktabactive = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_BACKTABACTIVE') ? $colorbacktabactive : $conf->global->THEME_ELDY_BACKTABACTIVE) : (empty($user->
conf->THEME_ELDY_BACKTABACTIVE) ? $colorbacktabactive : $user->
conf->THEME_ELDY_BACKTABACTIVE);
223$colorbacklineimpair1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_LINEIMPAIR1') ? $colorbacklineimpair1 : $conf->global->THEME_ELDY_LINEIMPAIR1) : (empty($user->
conf->THEME_ELDY_LINEIMPAIR1) ? $colorbacklineimpair1 : $user->
conf->THEME_ELDY_LINEIMPAIR1);
224$colorbacklineimpair2 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_LINEIMPAIR2') ? $colorbacklineimpair2 : $conf->global->THEME_ELDY_LINEIMPAIR2) : (empty($user->
conf->THEME_ELDY_LINEIMPAIR2) ? $colorbacklineimpair2 : $user->
conf->THEME_ELDY_LINEIMPAIR2);
225$colorbacklinepair1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_LINEPAIR1') ? $colorbacklinepair1 : $conf->global->THEME_ELDY_LINEPAIR1) : (empty($user->
conf->THEME_ELDY_LINEPAIR1) ? $colorbacklinepair1 : $user->
conf->THEME_ELDY_LINEPAIR1);
226$colorbacklinepair2 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_LINEPAIR2') ? $colorbacklinepair2 : $conf->global->THEME_ELDY_LINEPAIR2) : (empty($user->
conf->THEME_ELDY_LINEPAIR2) ? $colorbacklinepair2 : $user->
conf->THEME_ELDY_LINEPAIR2);
227$colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_LINEBREAK') ? $colorbacklinebreak : $conf->global->THEME_ELDY_LINEBREAK) : (empty($user->
conf->THEME_ELDY_LINEBREAK) ? $colorbacklinebreak : $user->
conf->THEME_ELDY_LINEBREAK);
228$colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXTTITLENOTAB') ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->
conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->
conf->THEME_ELDY_TEXTTITLENOTAB);
229$colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXTTITLE') ? $colortexttitle : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->
conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->
conf->THEME_ELDY_TEXTTITLE);
230$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXTTITLELINK') ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->
conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->
conf->THEME_ELDY_TEXTTITLELINK);
231$colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXT') ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->
conf->THEME_ELDY_TEXT) ? $colortext : $user->
conf->THEME_ELDY_TEXT);
232$colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXTLINK') ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->
conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->
conf->THEME_ELDY_TEXTLINK);
233$colortextlinkHsla =
colorHexToHsl($colortextlink,
false,
true);
235$butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_BTNACTION') ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->
conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->
conf->THEME_ELDY_BTNACTION);
236$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_TEXTBTNACTION') ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->
conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->
conf->THEME_ELDY_TEXTBTNACTION);
237$fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_FONT_SIZE1') ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->
conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->
conf->THEME_ELDY_FONT_SIZE1);
238$fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_FONT_SIZE2') ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->
conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->
conf->THEME_ELDY_FONT_SIZE2);
239$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_USECOMOACTROW') ?
'155%' :
'300%') : (empty($user->
conf->THEME_ELDY_USECOMOACTROW) ?
'155%' :
'300%');
241$colorbacklinepairhover = ((!isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER ===
'255,255,255') ?
'' : ($conf->global->THEME_ELDY_USE_HOVER ===
'1' ?
'e6edf0' : $conf->global->THEME_ELDY_USE_HOVER));
242$colorbacklinepairchecked = ((!isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED ===
'255,255,255') ?
'' : ($conf->global->THEME_ELDY_USE_CHECKED ===
'1' ?
'e6edf0' : $conf->global->THEME_ELDY_USE_CHECKED));
243if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) {
244 $colorbacklinepairhover = ((!isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER ===
'0') ?
'' : ($user->
conf->THEME_ELDY_USE_HOVER ===
'1' ?
'e6edf0' : $user->
conf->THEME_ELDY_USE_HOVER));
245 $colorbacklinepairchecked = ((!isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED ===
'0') ?
'' : ($user->
conf->THEME_ELDY_USE_CHECKED ===
'1' ?
'e6edf0' : $user->
conf->THEME_ELDY_USE_CHECKED));
251$tmppart = explode(
',', $colorbackhmenu1);
252$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
254 $colortextbackhmenu =
'FFFFFF';
256 $colortextbackhmenu =
'000000';
260$tmppart = explode(
',', $colorbackvmenu1);
261$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
263 $colortextbackvmenu =
'FFFFFF';
265 $colortextbackvmenu =
'222222';
271$tmppart = explode(
',', $colorbacktitle1);
272if ($colortexttitle ==
'') {
273 $tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
274 if ($tmpval <= 460) {
275 $colortexttitle =
'FFFFFF';
276 $colorshadowtitle =
'888888';
278 $colortexttitle =
'000000';
279 $colorshadowtitle =
'FFFFFF';
282 $colorshadowtitle =
'888888';
286$tmppart = explode(
',', $colorbacktabcard1);
287$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
289 $colortextbacktab =
'FFFFFF';
291 $colortextbacktab =
'000000';
305if ($colorbacklinepairhover !=
'') {
308if ($colorbacklinepairchecked !=
'') {
309 $colorbacklinepairchecked = implode(
',',
colorStringToArray($colorbacklinepairchecked));
318$nbtopmenuentries = $menumanager->showmenu(
'topnb');
319$nbtopmenuentriesreal = $nbtopmenuentries;
320if ($conf->browser->layout ==
'phone') {
321 $nbtopmenuentries = max($nbtopmenuentries, 10);
328$maxwidthloginblock = 180;
329if (
getDolGlobalInt(
'THEME_TOPMENU_DISABLE_IMAGE') == 1 || !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
331 $maxwidthloginblock += 50;
336 $maxwidthloginblock += 55;
339 $maxwidthloginblock += 55;
341if (isModEnabled(
'bookmark')) {
342 $maxwidthloginblock += 55;
347print
'colorbackbody='.$colorbackbody.
"\n";
348print
'colorbackvmenu1='.$colorbackvmenu1.
"\n";
349print
'colorbackhmenu1='.$colorbackhmenu1.
"\n";
350print
'colorbacktitle1='.$colorbacktitle1.
"\n";
351print
'colorbacklineimpair1='.$colorbacklineimpair1.
"\n";
352print
'colorbacklineimpair2='.$colorbacklineimpair2.
"\n";
353print
'colorbacklinepair1='.$colorbacklinepair1.
"\n";
354print
'colorbacklinepair2='.$colorbacklinepair2.
"\n";
355print
'colorbacklinepairhover='.$colorbacklinepairhover.
"\n";
356print
'colorbacklinepairchecked='.$colorbacklinepairchecked.
"\n";
357print
'$colortexttitlenotab='.$colortexttitlenotab.
"\n";
358print
'$colortexttitle='.$colortexttitle.
"\n";
359print
'$colortext='.$colortext.
"\n";
360print
'$colortextlink='.$colortextlink.
"\n";
361print
'$colortextbackhmenu='.$colortextbackhmenu.
"\n";
362print
'$colortextbackvmenu='.$colortextbackvmenu.
"\n";
363print
'dol_hide_topmenu='.$dol_hide_topmenu.
"\n";
364print
'dol_hide_leftmenu='.$dol_hide_leftmenu.
"\n";
365print
'dol_optimize_smallscreen='.$dol_optimize_smallscreen.
"\n";
366print
'dol_no_mouse_hover='.$dol_no_mouse_hover.
"\n";
367print
'dol_screenwidth='.(empty($_SESSION[
'dol_screenwidth']) ?
'' : $_SESSION[
'dol_screenwidth']).
"\n";
368print
'dol_screenheight='.(empty($_SESSION[
'dol_screenheight']) ?
'' : $_SESSION[
'dol_screenheight']).
"\n";
369print
'fontsize='.$fontsize.
"\n";
370print
'nbtopmenuentries='.$nbtopmenuentries.
"\n";
371print
'fontsizesmaller='.$fontsizesmaller.
"\n";
372print
'topMenuFontSize='.$topMenuFontSize.
"\n";
373print
'toolTipBgColor='.$toolTipBgColor.
"\n";
374print
'toolTipFontColor='.$toolTipFontColor.
"\n";
375print
'conf->global->THEME_SATURATE_RATIO='.getDolGlobalString(
'THEME_SATURATE_RATIO').
" (must be between 0 and 1)\n";
380require __DIR__.
'/global.inc.php';
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
colorHexToHsl($hex, $alpha=false, $returnArray=false)
Color Hex to Hsl (used for style)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.