2023-09-12 15:12:30 +02:00
< ? php
2024-03-05 17:24:18 +01:00
/* Copyright ( C ) 2023 - 2024 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2023 - 2024 Lionel Vessiller < lvessiller @ easya . solutions >
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
/**
* \file htdocs / public / webportal / css / themes / custom . css . php
* \ingroup webportal
* \brief Custom css files for WebPortal
*/
2023-09-12 15:12:30 +02:00
if ( ! defined ( 'NOREQUIRESOC' )) {
define ( 'NOREQUIRESOC' , '1' );
}
if ( ! defined ( 'NOCSRFCHECK' )) {
define ( 'NOCSRFCHECK' , 1 );
}
if ( ! defined ( 'NOTOKENRENEWAL' )) {
define ( 'NOTOKENRENEWAL' , 1 );
}
if ( ! defined ( 'NOLOGIN' )) {
define ( 'NOLOGIN' , 1 ); // File must be accessed by logon page so without login.
}
if ( ! defined ( 'NOREQUIREHTML' )) {
define ( 'NOREQUIREHTML' , 1 );
}
if ( ! defined ( 'NOREQUIREAJAX' )) {
define ( 'NOREQUIREAJAX' , '1' );
}
session_cache_limiter ( 'public' );
2024-09-20 00:50:25 +02:00
if ( ! defined ( 'MAIN_INC_REL_DIR' )) {
define ( 'MAIN_INC_REL_DIR' , '../../' );
}
2023-09-28 14:01:55 +02:00
require_once __DIR__ . '/../../webportal.main.inc.php' ;
dol_include_once ( '/webportal/class/webPortalTheme.class.php' );
2023-09-12 15:12:30 +02:00
// Define css type
2024-09-20 01:29:13 +02:00
top_httphead ( 'text/css' );
/*
2023-09-12 15:12:30 +02:00
header ( " Content-Type: text/css " );
header ( " X-Content-Type-Options: nosniff " );
header ( " X-Frame-Options: SAMEORIGIN " );
2024-09-20 01:29:13 +02:00
*/
2023-09-12 15:12:30 +02:00
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
2024-09-20 01:29:13 +02:00
if ( empty ( $dolibarr_nocache )) {
2023-09-12 15:12:30 +02:00
header ( 'Cache-Control: max-age=10800, public, must-revalidate' );
2024-09-20 01:29:13 +02:00
} else {
2023-09-12 15:12:30 +02:00
header ( 'Cache-Control: no-cache' );
2024-09-20 01:29:13 +02:00
}
2023-09-12 15:12:30 +02:00
2023-09-28 10:44:22 +02:00
$webPortalTheme = new WebPortalTheme ();
?>
[ data - theme = " custom " ], : root {
2023-09-28 14:18:56 +02:00
-- primary - color - hue : < ? php print $webPortalTheme -> primaryColorHsl [ 'h' ]; ?> ;
-- primary - color - saturation : < ? php print $webPortalTheme -> primaryColorHsl [ 's' ]; ?> %;
-- primary - color - lightness : < ? php print $webPortalTheme -> primaryColorHsl [ 'l' ]; ?> %;
-- banner - background : url ( < ? php print ! empty ( $webPortalTheme -> bannerBackground ) ? $webPortalTheme -> bannerBackground : '../img/banner.svg' ?> );
2023-09-28 10:44:22 +02:00
}
. login - page {
2023-09-28 14:18:56 +02:00
< ? php
if ( ! empty ( $webPortalTheme -> loginBackground )) {
print '--login-background: rgba(0, 0, 0, 0.4) url("' . $webPortalTheme -> loginBackground . '");' . " \n " ;
}
2023-09-28 10:44:22 +02:00
2023-09-28 14:18:56 +02:00
if ( ! empty ( $webPortalTheme -> loginLogoUrl )) {
2024-02-10 17:27:36 +01:00
print '--login-logo: url("' . $webPortalTheme -> loginLogoUrl . '"); /* for relative path, must be relative to the css file or use full url starting by http:// */' . " \n " ;
2023-09-28 14:18:56 +02:00
}
?>
2023-09-28 10:44:22 +02:00
}
< ? php
2024-09-20 01:20:35 +02:00
print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS */' . " \n " ;
2023-09-12 15:12:30 +02:00
print getDolGlobalString ( 'WEBPORTAL_CUSTOM_CSS' );