dolibarr 21.0.0-alpha
style.css.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4 * Copyright (C) 2007-2017 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
6 * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
7 * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
8 * Copyright (C) 2021-2023 Anthony Berton <anthony.berton@bb2a.fr>
9 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
30//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
31//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
32if (!defined('NOREQUIRESOC')) {
33 define('NOREQUIRESOC', '1');
34}
35//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
36if (!defined('NOCSRFCHECK')) {
37 define('NOCSRFCHECK', 1);
38}
39if (!defined('NOTOKENRENEWAL')) {
40 define('NOTOKENRENEWAL', 1);
41}
42if (!defined('NOLOGIN')) {
43 define('NOLOGIN', 1); // File must be accessed by logon page so without login.
44}
45//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We load menu manager class (note that object loaded may have wrong content because NOLOGIN is set and some values depends on login)
46if (!defined('NOREQUIREHTML')) {
47 define('NOREQUIREHTML', 1);
48}
49if (!defined('NOREQUIREAJAX')) {
50 define('NOREQUIREAJAX', '1');
51}
52
53
54define('ISLOADEDBYSTEELSHEET', '1');
55
56
57require __DIR__.'/theme_vars.inc.php';
58if (defined('THEME_ONLY_CONSTANT')) {
59 return;
60}
61// Types from theme_vars
62'
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
95';
96
97
98session_cache_limiter('public');
99
100require_once __DIR__.'/../../main.inc.php'; // __DIR__ allow this script to be included in custom themes
101require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
102
103// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined)
104// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile.
105if (empty($user->id) && !empty($_SESSION['dol_login'])) {
106 $user->fetch(0, $_SESSION['dol_login'], '', 1);
107 $user->loadRights();
108
109 // Reload menu now we have the good user (and we need the good menu to have ->showmenu('topnb') correct.
110 // @phan-suppress-next-line PhanRedefinedClassReference
111 $menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1);
112 // @phan-suppress-next-line PhanRedefinedClassReference
113 $menumanager->loadMenu();
114}
115
116
117// Define css type
118top_httphead('text/css');
119// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
120if (empty($dolibarr_nocache)) {
121 header('Cache-Control: max-age=10800, public, must-revalidate');
122} else {
123 header('Cache-Control: no-cache');
124}
125
126if (GETPOST('theme', 'aZ09')) {
127 $conf->theme = GETPOST('theme', 'aZ09'); // If theme was forced on URL
128}
129if (GETPOST('lang', 'aZ09')) {
130 $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
131}
132if (GETPOSTISSET('THEME_DARKMODEENABLED')) {
133 $conf->global->THEME_DARKMODEENABLED = GETPOSTINT('THEME_DARKMODEENABLED'); // If darkmode was forced on URL
134}
135
136$langs->load("main", 0, 1);
137$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
138$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
139
140$path = ''; // This value may be used in future for external module to overwrite theme
141$theme = 'eldy'; // Value of theme
142if (getDolGlobalString('MAIN_OVERWRITE_THEME_RES')) {
143 $path = '/' . getDolGlobalString('MAIN_OVERWRITE_THEME_RES');
144 $theme = getDolGlobalString('MAIN_OVERWRITE_THEME_RES');
145}
146
147// Define image path files and other constants
148
149//$fontlist='helvetica, verdana, arial, sans-serif';
150//$fontlist='"open sans", "Helvetica Neue", Helvetica, Arial, sans-serif';
151
152$fontlist = 'arial,tahoma,verdana,helvetica';
153if (getDolGlobalString('THEME_FONT_FAMILY')) {
154 $fontlist = getDolGlobalString('THEME_FONT_FAMILY').', '.$fontlist;
155}
156
157$img_head = '';
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;
163
164//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
165//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0;
166//var_dump($user->conf->THEME_ELDY_RGB);
167
168$useboldtitle = getDolGlobalInt('THEME_ELDY_USEBOLDTITLE');
169$userborderontable = getDolGlobalInt('THEME_ELDY_USEBORDERONTABLE');
170$borderwidth = 1;
171
172// Case of option always editable
173if (!isset($conf->global->THEME_ELDY_BACKBODY)) {
174 $conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
175}
176if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
177 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
178}
179if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) {
180 $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
181}
182if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) {
183 $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
184}
185if (!isset($conf->global->THEME_ELDY_USE_HOVER)) {
186 $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
187}
188if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) {
189 $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
190}
191if (!isset($conf->global->THEME_ELDY_LINEBREAK)) {
192 $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
193}
194if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) {
195 $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
196}
197if (!isset($conf->global->THEME_ELDY_TEXTLINK)) {
198 $conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
199}
200if (!isset($conf->global->THEME_ELDY_BTNACTION)) {
201 $conf->global->THEME_ELDY_BTNACTION = $butactionbg;
202}
203if (!isset($conf->global->THEME_ELDY_TEXTBTNACTION)) {
204 $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction;
205}
206// Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on
207if (!getDolGlobalString('THEME_ELDY_ENABLE_PERSONALIZED')) {
208 $conf->global->THEME_ELDY_BACKTABCARD1 = '255,255,255'; // card
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';
213}
214
215// Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on
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);
234
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%');
240// Hover color
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));
246}
247
248
249// Set text color to black or white
250$colorbackhmenu1 = implode(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
251$tmppart = explode(',', $colorbackhmenu1);
252$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
253if ($tmpval <= 460) {
254 $colortextbackhmenu = 'FFFFFF';
255} else {
256 $colortextbackhmenu = '000000';
257}
258
259$colorbackvmenu1 = implode(',', colorStringToArray($colorbackvmenu1)); // Normalize value to 'x,y,z'
260$tmppart = explode(',', $colorbackvmenu1);
261$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
262if ($tmpval <= 460) {
263 $colortextbackvmenu = 'FFFFFF';
264} else {
265 $colortextbackvmenu = '222222';
266}
267
268$colortopbordertitle1 = implode(',', colorStringToArray($colortopbordertitle1)); // Normalize value to 'x,y,z'
269
270$colorbacktitle1 = implode(',', colorStringToArray($colorbacktitle1)); // Normalize value to 'x,y,z'
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';
277 } else {
278 $colortexttitle = '000000';
279 $colorshadowtitle = 'FFFFFF';
280 }
281} else {
282 $colorshadowtitle = '888888';
283}
284
285$colorbacktabcard1 = implode(',', colorStringToArray($colorbacktabcard1)); // Normalize value to 'x,y,z'
286$tmppart = explode(',', $colorbacktabcard1);
287$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
288if ($tmpval <= 460) {
289 $colortextbacktab = 'FFFFFF';
290} else {
291 $colortextbacktab = '000000';
292}
293
294
295// Format color value to match expected format (may be 'FFFFFF' or '255,255,255')
296$colorbackhmenu1 = implode(',', colorStringToArray($colorbackhmenu1));
297$colorbackvmenu1 = implode(',', colorStringToArray($colorbackvmenu1));
298$colorbacktitle1 = implode(',', colorStringToArray($colorbacktitle1));
299$colorbacktabcard1 = implode(',', colorStringToArray($colorbacktabcard1));
300$colorbacktabactive = implode(',', colorStringToArray($colorbacktabactive));
301$colorbacklineimpair1 = implode(',', colorStringToArray($colorbacklineimpair1));
302$colorbacklineimpair2 = implode(',', colorStringToArray($colorbacklineimpair2));
303$colorbacklinepair1 = implode(',', colorStringToArray($colorbacklinepair1));
304$colorbacklinepair2 = implode(',', colorStringToArray($colorbacklinepair2));
305if ($colorbacklinepairhover != '') {
306 $colorbacklinepairhover = implode(',', colorStringToArray($colorbacklinepairhover));
307}
308if ($colorbacklinepairchecked != '') {
309 $colorbacklinepairchecked = implode(',', colorStringToArray($colorbacklinepairchecked));
310}
311$colorbackbody = implode(',', colorStringToArray($colorbackbody));
312$colortexttitlenotab = implode(',', colorStringToArray($colortexttitlenotab));
313$colortexttitle = implode(',', colorStringToArray($colortexttitle));
314$colortext = implode(',', colorStringToArray($colortext));
315$colortextlink = implode(',', colorStringToArray($colortextlink));
316
317// @phan-suppress-next-line PhanRedefinedClassReference
318$nbtopmenuentries = $menumanager->showmenu('topnb');
319$nbtopmenuentriesreal = $nbtopmenuentries;
320if ($conf->browser->layout == 'phone') {
321 $nbtopmenuentries = max($nbtopmenuentries, 10);
322}
323
324$minwidthtmenu = 66; /* minimum width for one top menu entry */
325$heightmenu = 50; /* height of top menu, part with image */
326$heightmenu2 = 49; /* height of top menu, part with login */
327$disableimages = 0;
328$maxwidthloginblock = 180;
329if (getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE') == 1 || !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
330 $disableimages = 1;
331 $maxwidthloginblock += 50;
332 $minwidthtmenu = 0;
333}
334
335if (getDolGlobalString('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN')) {
336 $maxwidthloginblock += 55;
337}
338if (getDolGlobalString('MAIN_USE_TOP_MENU_SEARCH_DROPDOWN')) {
339 $maxwidthloginblock += 55;
340}
341if (isModEnabled('bookmark')) {
342 $maxwidthloginblock += 55;
343}
344
345
346print '/*'."\n";
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";
376print '*/'."\n";
377
378
379// Include the global.inc.php that include the badges, btn, info-box, dropdown, progress...
380require __DIR__.'/global.inc.php';
381
382if (is_object($db)) {
383 $db->close();
384}
Class to manage menu Auguria.
loadMenu($forcemainmenu='', $forceleftmenu='')
Load this->tabMenu.
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)
Definition inc.php:420
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.