33if (!defined(
'NOREQUIRESOC')) {
34 define(
'NOREQUIRESOC',
'1');
37if (!defined(
'NOCSRFCHECK')) {
38 define(
'NOCSRFCHECK', 1);
40if (!defined(
'NOTOKENRENEWAL')) {
41 define(
'NOTOKENRENEWAL', 1);
43if (!defined(
'NOLOGIN')) {
47if (!defined(
'NOREQUIREHTML')) {
48 define(
'NOREQUIREHTML', 1);
50if (!defined(
'NOREQUIREAJAX')) {
51 define(
'NOREQUIREAJAX',
'1');
55define(
'ISLOADEDBYSTEELSHEET',
'1');
58require __DIR__.
'/theme_vars.inc.php';
59if (defined(
'THEME_ONLY_CONSTANT')) {
64@phan-var-force string $badgeWarning
65@phan-var-force string $butactionbg
66@phan-var-force string $colorbackbody
67@phan-var-force string $colorbackhmenu1
68@phan-var-force string $colorbacklinebreak
69@phan-var-force string $colorbacklineimpair1
70@phan-var-force string $colorbacklineimpair2
71@phan-var-force string $colorbacklinepair1
72@phan-var-force string $colorbacklinepair2
73@phan-var-force string $colorbacklinepairchecked
74@phan-var-force string $colorbacklinepairhover
75@phan-var-force string $colorbacktabactive
76@phan-var-force string $colorbacktabcard1
77@phan-var-force string $colorbacktitle1
78@phan-var-force string $colorbackvmenu1
79@phan-var-force string $colorblind_deuteranopes_textSuccess
80@phan-var-force string $colorblind_deuteranopes_textWarning
81@phan-var-force string $colortext
82@phan-var-force string $colortextlink
83@phan-var-force string $colortexttitle
84@phan-var-force string $colortexttitlelink
85@phan-var-force string $colortexttitlenotab
86@phan-var-force string $colortexttitlenotab2
87@phan-var-force string $colortopbordertitle1
88@phan-var-force string $fontsize
89@phan-var-force string $textDanger
90@phan-var-force string $textSuccess
91@phan-var-force string $textWarning
92@phan-var-force string $textbutaction
93@phan-var-force string $toolTipBgColor
94@phan-var-force string $toolTipFontColor
95@phan-var-force string $topMenuFontSize
99session_cache_limiter(
'public');
101require_once __DIR__.
'/../../main.inc.php';
102require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
144if (empty($user->id) && !empty($_SESSION[
'dol_login'])) {
145 $user->fetch(0, $_SESSION[
'dol_login'],
'', 1);
150 $menumanager =
new MenuManager($db, empty($user->socid) ? 0 : 1);
159if (empty($dolibarr_nocache)) {
160 header(
'Cache-Control: max-age=10800, public, must-revalidate');
162 header(
'Cache-Control: no-cache');
169 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
171if (GETPOSTISSET(
'THEME_DARKMODEENABLED')) {
172 $conf->global->THEME_DARKMODEENABLED =
GETPOSTINT(
'THEME_DARKMODEENABLED');
175$langs->load(
"main", 0, 1);
176$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
177$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
191$fontlist =
'arial,tahoma,verdana,helvetica';
197$img_button =
dol_buildpath($path.
'/theme/'.$theme.
'/img/button_bg.png', 1);
198$dol_hide_topmenu =
$conf->dol_hide_topmenu;
199$dol_hide_leftmenu =
$conf->dol_hide_leftmenu;
200$dol_optimize_smallscreen =
$conf->dol_optimize_smallscreen;
201$dol_no_mouse_hover =
$conf->dol_no_mouse_hover;
212if (!isset(
$conf->global->THEME_ELDY_BACKBODY)) {
213 $conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
215if (!isset(
$conf->global->THEME_ELDY_TOPMENU_BACK1)) {
216 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
218if (!isset(
$conf->global->THEME_ELDY_VERMENU_BACK1)) {
219 $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
221if (!isset(
$conf->global->THEME_ELDY_BACKTITLE1)) {
222 $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
224if (!isset(
$conf->global->THEME_ELDY_USE_HOVER)) {
225 $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
227if (!isset(
$conf->global->THEME_ELDY_USE_CHECKED)) {
228 $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
230if (!isset(
$conf->global->THEME_ELDY_LINEBREAK)) {
231 $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
233if (!isset(
$conf->global->THEME_ELDY_TEXTTITLENOTAB)) {
234 $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
236if (!isset(
$conf->global->THEME_ELDY_TEXTLINK)) {
237 $conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
239if (!isset(
$conf->global->THEME_ELDY_BTNACTION)) {
240 $conf->global->THEME_ELDY_BTNACTION = $butactionbg;
242if (!isset(
$conf->global->THEME_ELDY_TEXTBTNACTION)) {
243 $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction;
247 $conf->global->THEME_ELDY_BACKTABCARD1 =
'255,255,255';
248 $conf->global->THEME_ELDY_BACKTABACTIVE =
'234,234,234';
249 $conf->global->THEME_ELDY_TEXT =
'0,0,0';
250 $conf->global->THEME_ELDY_FONT_SIZE1 = $fontsize;
251 $conf->global->THEME_ELDY_FONT_SIZE2 =
'0.75em';
255$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);
256$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);
257$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);
258$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);
259$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);
260$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);
261$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);
262$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);
263$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);
264$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);
265$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);
266$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);
267$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);
268$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);
269$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);
270$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);
271$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);
272$colortextlinkHsla =
colorHexToHsl($colortextlink,
false,
true);
274$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);
275$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);
276$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);
277$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);
278$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (!
getDolGlobalString(
'THEME_ELDY_USECOMOACTROW') ?
'155%' :
'300%') : (empty($user->
conf->THEME_ELDY_USECOMOACTROW) ?
'155%' :
'300%');
280$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));
281$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));
282if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) {
283 $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));
284 $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));
290$tmppart = explode(
',', $colorbackhmenu1);
291$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
293 $colortextbackhmenu =
'FFFFFF';
295 $colortextbackhmenu =
'000000';
299$tmppart = explode(
',', $colorbackvmenu1);
300$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
302 $colortextbackvmenu =
'FFFFFF';
304 $colortextbackvmenu =
'222222';
310$tmppart = explode(
',', $colorbacktitle1);
311if ($colortexttitle ==
'') {
312 $tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
313 if ($tmpval <= 460) {
314 $colortexttitle =
'FFFFFF';
315 $colorshadowtitle =
'888888';
317 $colortexttitle =
'000000';
318 $colorshadowtitle =
'FFFFFF';
321 $colorshadowtitle =
'888888';
325$tmppart = explode(
',', $colorbacktabcard1);
326$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
328 $colortextbacktab =
'FFFFFF';
330 $colortextbacktab =
'000000';
344if ($colorbacklinepairhover !=
'') {
347if ($colorbacklinepairchecked !=
'') {
348 $colorbacklinepairchecked = implode(
',',
colorStringToArray($colorbacklinepairchecked));
357$nbtopmenuentries = $menumanager->showmenu(
'topnb');
358$nbtopmenuentriesreal = $nbtopmenuentries;
359if (
$conf->browser->layout ==
'phone') {
360 $nbtopmenuentries = max($nbtopmenuentries, 10);
367$maxwidthloginblock = 180;
368if (
getDolGlobalInt(
'THEME_TOPMENU_DISABLE_IMAGE') == 1 || !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
370 $maxwidthloginblock += 50;
375 $maxwidthloginblock += 55;
378 $maxwidthloginblock += 55;
380if (isModEnabled(
'bookmark')) {
381 $maxwidthloginblock += 55;
386print
'colorbackbody='.$colorbackbody.
"\n";
387print
'colorbackvmenu1='.$colorbackvmenu1.
"\n";
388print
'colorbackhmenu1='.$colorbackhmenu1.
"\n";
389print
'colorbacktitle1='.$colorbacktitle1.
"\n";
390print
'colorbacklineimpair1='.$colorbacklineimpair1.
"\n";
391print
'colorbacklineimpair2='.$colorbacklineimpair2.
"\n";
392print
'colorbacklinepair1='.$colorbacklinepair1.
"\n";
393print
'colorbacklinepair2='.$colorbacklinepair2.
"\n";
394print
'colorbacklinepairhover='.$colorbacklinepairhover.
"\n";
395print
'colorbacklinepairchecked='.$colorbacklinepairchecked.
"\n";
396print
'$colortexttitlenotab='.$colortexttitlenotab.
"\n";
397print
'$colortexttitle='.$colortexttitle.
"\n";
398print
'$colortext='.$colortext.
"\n";
399print
'$colortextlink='.$colortextlink.
"\n";
400print
'$colortextbackhmenu='.$colortextbackhmenu.
"\n";
401print
'$colortextbackvmenu='.$colortextbackvmenu.
"\n";
402print
'dol_hide_topmenu='.$dol_hide_topmenu.
"\n";
403print
'dol_hide_leftmenu='.$dol_hide_leftmenu.
"\n";
404print
'dol_optimize_smallscreen='.$dol_optimize_smallscreen.
"\n";
405print
'dol_no_mouse_hover='.$dol_no_mouse_hover.
"\n";
406print
'dol_screenwidth='.(empty($_SESSION[
'dol_screenwidth']) ?
'' : $_SESSION[
'dol_screenwidth']).
"\n";
407print
'dol_screenheight='.(empty($_SESSION[
'dol_screenheight']) ?
'' : $_SESSION[
'dol_screenheight']).
"\n";
408print
'fontsize='.$fontsize.
"\n";
409print
'nbtopmenuentries='.$nbtopmenuentries.
"\n";
410print
'fontsizesmaller='.$fontsizesmaller.
"\n";
411print
'topMenuFontSize='.$topMenuFontSize.
"\n";
412print
'toolTipBgColor='.$toolTipBgColor.
"\n";
413print
'toolTipFontColor='.$toolTipFontColor.
"\n";
414print
'conf->global->THEME_SATURATE_RATIO='.getDolGlobalString(
'THEME_SATURATE_RATIO').
" (must be between 0 and 1)\n";
419require __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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...