From e5058a251dac8416760d7d01726483c9ac45eff8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Sep 2018 12:27:08 +0200 Subject: [PATCH] Use colored gradient background on login page --- htdocs/core/tpl/login.tpl.php | 11 ++++++++++- htdocs/core/tpl/passwordforgotten.tpl.php | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 02fdedb7f2a..ccac70f4081 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -19,6 +19,7 @@ // Need global variable $title to be defined by caller (like dol_loginfunction) // Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...); + // Protection to avoid direct call of template if (empty($conf) || ! is_object($conf)) { @@ -27,6 +28,8 @@ if (empty($conf) || ! is_object($conf)) } +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); @@ -55,10 +58,16 @@ if (! preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenof print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow); + +$colorbackhmenu1='60,70,100'; // topmenu +if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; +$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); +$colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' + ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.'), rgb(240,240,240));"':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> dol_use_jmobile)) { ?>