31if (!defined(
'NOREQUIRESOC')) {
32 define(
'NOREQUIRESOC',
'1');
35if (!defined(
'NOCSRFCHECK')) {
36 define(
'NOCSRFCHECK', 1);
38if (!defined(
'NOTOKENRENEWAL')) {
39 define(
'NOTOKENRENEWAL', 1);
41if (!defined(
'NOLOGIN')) {
45if (!defined(
'NOREQUIREHTML')) {
46 define(
'NOREQUIREHTML', 1);
48if (!defined(
'NOREQUIREAJAX')) {
49 define(
'NOREQUIREAJAX',
'1');
53define(
'ISLOADEDBYSTEELSHEET',
'1');
56require __DIR__.
'/theme_vars.inc.php';
57if (defined(
'THEME_ONLY_CONSTANT')) {
62session_cache_limiter(
'public');
64require_once __DIR__.
'/../../main.inc.php';
65require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
69if (empty($user->id) && !empty($_SESSION[
'dol_login'])) {
70 $user->fetch(
'', $_SESSION[
'dol_login'],
'', 1);
74 $menumanager =
new MenuManager($db, empty($user->socid) ? 0 : 1);
82if (empty($dolibarr_nocache)) {
83 header(
'Cache-Control: max-age=10800, public, must-revalidate');
85 header(
'Cache-Control: no-cache');
89 $conf->theme =
GETPOST(
'theme',
'aZ09');
92 $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
94if (GETPOSTISSET(
'THEME_DARKMODEENABLED')) {
95 $conf->global->THEME_DARKMODEENABLED =
GETPOST(
'THEME_DARKMODEENABLED',
'int');
98$langs->load(
"main", 0, 1);
99$right = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'left' :
'right');
100$left = ($langs->trans(
"DIRECTION") ==
'rtl' ?
'right' :
'left');
104if (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
105 $path =
'/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme = $conf->global->MAIN_OVERWRITE_THEME_RES;
109$fontlist =
'arial,tahoma,verdana,helvetica';
112$img_button =
dol_buildpath($path.
'/theme/'.$theme.
'/img/button_bg.png', 1);
113$dol_hide_topmenu = $conf->dol_hide_topmenu;
114$dol_hide_leftmenu = $conf->dol_hide_leftmenu;
115$dol_optimize_smallscreen = $conf->dol_optimize_smallscreen;
116$dol_no_mouse_hover = $conf->dol_no_mouse_hover;
127if (!isset($conf->global->THEME_ELDY_BACKBODY)) {
128 $conf->global->THEME_ELDY_BACKBODY = $colorbackbody;
130if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
131 $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
133if (!isset($conf->global->THEME_ELDY_VERMENU_BACK1)) {
134 $conf->global->THEME_ELDY_VERMENU_BACK1 = $colorbackvmenu1;
136if (!isset($conf->global->THEME_ELDY_BACKTITLE1)) {
137 $conf->global->THEME_ELDY_BACKTITLE1 = $colorbacktitle1;
139if (!isset($conf->global->THEME_ELDY_USE_HOVER)) {
140 $conf->global->THEME_ELDY_USE_HOVER = $colorbacklinepairhover;
142if (!isset($conf->global->THEME_ELDY_USE_CHECKED)) {
143 $conf->global->THEME_ELDY_USE_CHECKED = $colorbacklinepairchecked;
145if (!isset($conf->global->THEME_ELDY_LINEBREAK)) {
146 $conf->global->THEME_ELDY_LINEBREAK = $colorbacklinebreak;
148if (!isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) {
149 $conf->global->THEME_ELDY_TEXTTITLENOTAB = $colortexttitlenotab;
151if (!isset($conf->global->THEME_ELDY_TEXTLINK)) {
152 $conf->global->THEME_ELDY_TEXTLINK = $colortextlink;
154if (!isset($conf->global->THEME_ELDY_BTNACTION)) {
155 $conf->global->THEME_ELDY_BTNACTION = $butactionbg;
157if (!isset($conf->global->THEME_ELDY_TEXTBTNACTION)) {
158 $conf->global->THEME_ELDY_TEXTBTNACTION = $textbutaction;
161if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) {
162 $conf->global->THEME_ELDY_BACKTABCARD1 =
'255,255,255';
163 $conf->global->THEME_ELDY_BACKTABACTIVE =
'234,234,234';
164 $conf->global->THEME_ELDY_TEXT =
'0,0,0';
165 $conf->global->THEME_ELDY_FONT_SIZE1 = $fontsize;
166 $conf->global->THEME_ELDY_FONT_SIZE2 =
'0.75em';
170$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->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);
171$colorbackvmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->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);
172$colortopbordertitle1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->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);
173$colorbacktitle1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKTITLE1) ? $colorbacktitle1 : $conf->global->THEME_ELDY_BACKTITLE1) : (empty($user->
conf->THEME_ELDY_BACKTITLE1) ? $colorbacktitle1 : $user->
conf->THEME_ELDY_BACKTITLE1);
174$colorbacktabcard1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKTABCARD1) ? $colorbacktabcard1 : $conf->global->THEME_ELDY_BACKTABCARD1) : (empty($user->
conf->THEME_ELDY_BACKTABCARD1) ? $colorbacktabcard1 : $user->
conf->THEME_ELDY_BACKTABCARD1);
175$colorbacktabactive = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKTABACTIVE) ? $colorbacktabactive : $conf->global->THEME_ELDY_BACKTABACTIVE) : (empty($user->
conf->THEME_ELDY_BACKTABACTIVE) ? $colorbacktabactive : $user->
conf->THEME_ELDY_BACKTABACTIVE);
176$colorbacklineimpair1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_LINEIMPAIR1) ? $colorbacklineimpair1 : $conf->global->THEME_ELDY_LINEIMPAIR1) : (empty($user->
conf->THEME_ELDY_LINEIMPAIR1) ? $colorbacklineimpair1 : $user->
conf->THEME_ELDY_LINEIMPAIR1);
177$colorbacklineimpair2 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_LINEIMPAIR2) ? $colorbacklineimpair2 : $conf->global->THEME_ELDY_LINEIMPAIR2) : (empty($user->
conf->THEME_ELDY_LINEIMPAIR2) ? $colorbacklineimpair2 : $user->
conf->THEME_ELDY_LINEIMPAIR2);
178$colorbacklinepair1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_LINEPAIR1) ? $colorbacklinepair1 : $conf->global->THEME_ELDY_LINEPAIR1) : (empty($user->
conf->THEME_ELDY_LINEPAIR1) ? $colorbacklinepair1 : $user->
conf->THEME_ELDY_LINEPAIR1);
179$colorbacklinepair2 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_LINEPAIR2) ? $colorbacklinepair2 : $conf->global->THEME_ELDY_LINEPAIR2) : (empty($user->
conf->THEME_ELDY_LINEPAIR2) ? $colorbacklinepair2 : $user->
conf->THEME_ELDY_LINEPAIR2);
180$colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_LINEBREAK) ? $colorbacklinebreak : $conf->global->THEME_ELDY_LINEBREAK) : (empty($user->
conf->THEME_ELDY_LINEBREAK) ? $colorbacklinebreak : $user->
conf->THEME_ELDY_LINEBREAK);
181$colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKBODY) ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->
conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->
conf->THEME_ELDY_BACKBODY);
182$colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->
conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->
conf->THEME_ELDY_TEXTTITLENOTAB);
183$colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->
conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->
conf->THEME_ELDY_TEXTTITLE);
184$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->
conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->
conf->THEME_ELDY_TEXTTITLELINK);
185$colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->
conf->THEME_ELDY_TEXT) ? $colortext : $user->
conf->THEME_ELDY_TEXT);
186$colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->
conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->
conf->THEME_ELDY_TEXTLINK);
187$butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->
conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->
conf->THEME_ELDY_BTNACTION);
188$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->
conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->
conf->THEME_ELDY_TEXTBTNACTION);
189$fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->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);
190$fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->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);
193$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));
194$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));
195if (!empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) {
196 $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));
197 $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));
203$tmppart = explode(
',', $colorbackhmenu1);
204$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
206 $colortextbackhmenu =
'FFFFFF';
208 $colortextbackhmenu =
'000000';
212$tmppart = explode(
',', $colorbackvmenu1);
213$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
215 $colortextbackvmenu =
'FFFFFF';
217 $colortextbackvmenu =
'000000';
223$tmppart = explode(
',', $colorbacktitle1);
224if ($colortexttitle ==
'') {
225 $tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
226 if ($tmpval <= 460) {
227 $colortexttitle =
'FFFFFF'; $colorshadowtitle =
'888888';
229 $colortexttitle =
'000000'; $colorshadowtitle =
'FFFFFF';
232 $colorshadowtitle =
'888888';
236$tmppart = explode(
',', $colorbacktabcard1);
237$tmpval = (!empty($tmppart[0]) ? $tmppart[0] : 0) + (!empty($tmppart[1]) ? $tmppart[1] : 0) + (!empty($tmppart[2]) ? $tmppart[2] : 0);
239 $colortextbacktab =
'FFFFFF';
241 $colortextbacktab =
'000000';
255if ($colorbacklinepairhover !=
'') {
258if ($colorbacklinepairchecked !=
'') {
267$nbtopmenuentries = $menumanager->showmenu(
'topnb');
269if ($conf->browser->layout ==
'phone') {
270 $nbtopmenuentries = max($nbtopmenuentries, 10);
278$maxwidthloginblock = 180;
280 $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0;
283if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
284 $maxwidthloginblock = $maxwidthloginblock + 55;
286if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
287 $maxwidthloginblock = $maxwidthloginblock + 55;
289if (!empty($conf->bookmark->enabled)) {
290 $maxwidthloginblock = $maxwidthloginblock + 55;
295print
'colorbackbody='.$colorbackbody.
"\n";
296print
'colorbackvmenu1='.$colorbackvmenu1.
"\n";
297print
'colorbackhmenu1='.$colorbackhmenu1.
"\n";
298print
'colorbacktitle1='.$colorbacktitle1.
"\n";
299print
'colorbacklineimpair1='.$colorbacklineimpair1.
"\n";
300print
'colorbacklineimpair2='.$colorbacklineimpair2.
"\n";
301print
'colorbacklinepair1='.$colorbacklinepair1.
"\n";
302print
'colorbacklinepair2='.$colorbacklinepair2.
"\n";
303print
'colorbacklinepairhover='.$colorbacklinepairhover.
"\n";
304print
'colorbacklinepairchecked='.$colorbacklinepairchecked.
"\n";
305print
'$colortexttitlenotab='.$colortexttitlenotab.
"\n";
306print
'$colortexttitle='.$colortexttitle.
"\n";
307print
'$colortext='.$colortext.
"\n";
308print
'$colortextlink='.$colortextlink.
"\n";
309print
'$colortextbackhmenu='.$colortextbackhmenu.
"\n";
310print
'$colortextbackvmenu='.$colortextbackvmenu.
"\n";
311print
'dol_hide_topmenu='.$dol_hide_topmenu.
"\n";
312print
'dol_hide_leftmenu='.$dol_hide_leftmenu.
"\n";
313print
'dol_optimize_smallscreen='.$dol_optimize_smallscreen.
"\n";
314print
'dol_no_mouse_hover='.$dol_no_mouse_hover.
"\n";
315print
'dol_screenwidth='.(empty($_SESSION[
'dol_screenwidth']) ?
'' : $_SESSION[
'dol_screenwidth']).
"\n";
316print
'dol_screenheight='.(empty($_SESSION[
'dol_screenheight']) ?
'' : $_SESSION[
'dol_screenheight']).
"\n";
317print
'fontsize='.$fontsize.
"\n";
318print
'nbtopmenuentries='.$nbtopmenuentries.
"\n";
319print
'fontsizesmaller='.$fontsizesmaller.
"\n";
320print
'topMenuFontSize='.$topMenuFontSize.
"\n";
321print
'toolTipBgColor='.$toolTipBgColor.
"\n";
322print
'toolTipFontColor='.$toolTipFontColor.
"\n";
323print
'conf->global->THEME_SATURATE_RATIO='.(empty($conf->global->THEME_SATURATE_RATIO) ?
'' : $conf->global->THEME_SATURATE_RATIO).
" (must be between 0 and 1)\n";
328require __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,...
getDolGlobalInt($key, $default=0)
Return 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.
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.