2
0
forked from Wavyzz/dolibarr

NEW webportal v2

This commit is contained in:
VESSILLER
2023-09-28 10:44:22 +02:00
parent 54bae2e5e2
commit 004782b5bb
32 changed files with 964 additions and 767 deletions

View File

@@ -2586,6 +2586,62 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false)
}
}
/**
* Color Hex to Hsl (used for style)
*
* @param string $hex Color in hex
* @param float|false $alpha 0 to 1 to add alpha channel
* @param bool $returnArray true=return an array instead, false=return string
* @return string|array String or array
*/
function colorHexToHsl($hex, $alpha = false, $returnArray = false)
{
$hex = str_replace('#', '', $hex);
$red = hexdec(substr($hex, 0, 2)) / 255;
$green = hexdec(substr($hex, 2, 2)) / 255;
$blue = hexdec(substr($hex, 4, 2)) / 255;
$cmin = min($red, $green, $blue);
$cmax = max($red, $green, $blue);
$delta = $cmax - $cmin;
if ($delta == 0) {
$hue = 0;
} elseif ($cmax === $red) {
$hue = (($green - $blue) / $delta);
} elseif ($cmax === $green) {
$hue = ($blue - $red) / $delta + 2;
} else {
$hue = ($red - $green) / $delta + 4;
}
$hue = round($hue * 60);
if ($hue < 0) {
$hue += 360;
}
$lightness = (($cmax + $cmin) / 2);
$saturation = $delta === 0 ? 0 : ($delta / (1 - abs(2 * $lightness - 1)));
if ($saturation < 0) {
$saturation += 1;
}
$lightness = round($lightness*100);
$saturation = round($saturation*100);
if ($returnArray) {
return array(
'h' => $hue,
'l' => $lightness,
's' => $saturation,
'a' => $alpha === false ? 1 : $alpha
);
} elseif ($alpha) {
return 'hsla('.$hue.', '.$saturation.', '.$lightness.' / '.$alpha.')';
} else {
return 'hsl('.$hue.', '.$saturation.', '.$lightness.')';
}
}
/**
* Applies the Cartesian product algorithm to an array

View File

@@ -103,6 +103,16 @@ $formSetup = new FormSetup($db);
$item = $formSetup->newItem('WEBPORTAL_ROOT_URL')->setAsString();
$item->fieldAttr = array('placeholder' => 'https://');
$item->helpText = $langs->transnoentities('WebPortalRootUrlHelp');
require_once __DIR__ . '/../public/class/context.class.php';
$context = Context::getInstance();
$item->fieldOutputOverride = '<a target="_blank" href="'.$context->getControllerUrl().'" ><i class="fa fa-arrow-right" ></i> '.$context->getControllerUrl().'</a>';
$formSetup->newItem('WEBPORTAL_TITLE')->defaultFieldValue = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
// Enable access for the membership record
$access_list = array(
@@ -342,8 +352,7 @@ $head = webportalAdminPrepareHead();
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webportal@webportal");
// Setup page goes here
echo '<span class="opacitymedium">' . $langs->trans("WebPortalSetupPage") . '</span><br><br>';
echo '<span class="opacitymedium">' . $langs->trans("WebPortalSetupPage") . ' : ' . $langs->trans('UserAccountForWebPortalAreInThirdPartyTabHelp') .'</span>.<br><br>';
if ($action == 'edit') {
print $formSetup->generateOutput(true);
@@ -619,10 +628,6 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
}
}
if (empty($setupnotempty)) {
print '<br>' . $langs->trans("NothingToSetup");
}
// Page end
print dol_get_fiche_end();

View File

@@ -0,0 +1,253 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Lionel Vessiller <lvessiller@open-dsi.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 admin/setup.php
* \ingroup webportal
* \brief WebPortal setup page.
*/
// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
}
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
$tmp2 = realpath(__FILE__);
$i = strlen($tmp) - 1;
$j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--;
$j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
}
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
$res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
}
// Try main.inc.php using relative path
if (!$res && file_exists("../../main.inc.php")) {
$res = @include "../../main.inc.php";
}
if (!$res && file_exists("../../../main.inc.php")) {
$res = @include "../../../main.inc.php";
}
if (!$res) {
die("Include of main fails");
}
global $conf, $db, $hookmanager, $langs, $user;
// Libraries
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
dol_include_once('/webportal/lib/webportal.lib.php');
// Translations
$langs->loadLangs(array("admin", "webportal"));
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('webportalthemesetup', 'globalsetup'));
// Access control
if (!$user->admin) {
accessforbidden();
}
// Parameters
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'myobject';
$error = 0;
$setupnotempty = 0;
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
$useFormSetup = 1;
if (!class_exists('FormSetup')) {
// For retrocompatibility Dolibarr < 16.0
if (floatval(DOL_VERSION) < 16.0 && !class_exists('FormSetup')) {
require_once __DIR__ . '/../backport/v16/core/class/html.formsetup.class.php';
} else {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php';
}
}
$formSetup = new FormSetup($db);
require_once __DIR__ . '/../public/class/webPortalTheme.class.php';
$webPortalTheme = new WebPortalTheme();
// Setup conf for secondary color
$item = $formSetup->newItem('WEBPORTAL_PRIMARY_COLOR');
$item->setAsColor();
$item->defaultFieldValue = $webPortalTheme->primaryColorHex;
// Logo URL
$item = $formSetup->newItem('WEBPORTAL_LOGIN_LOGO_URL');
$item->fieldAttr = array('type'=>'url', 'size'=> 50, 'placeholder'=>'http://');
$item = $formSetup->newItem('WEBPORTAL_MENU_LOGO_URL');
$item->fieldAttr = array('type'=>'url', 'size'=> 50, 'placeholder'=>'http://');
// Background URL
$item = $formSetup->newItem('WEBPORTAL_LOGIN_BACKGROUND');
$item->fieldAttr = array('type'=>'url', 'size'=> 50, 'placeholder'=>'http://');
$item = $formSetup->newItem('WEBPORTAL_BANNER_BACKGROUND');
$item->fieldAttr = array('type'=>'url', 'size'=> 50, 'placeholder'=>'http://');
$item = $formSetup->newItem('WEBPORTAL_BANNER_BACKGROUND_IS_DARK')->setAsYesNo();
// HTTP HOST
//$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
//$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
//$item->cssClass = 'minwidth500';
// Setup conf WEBPORTAL_MYPARAM1 as a simple string input
//$item = $formSetup->newItem('WEBPORTAL_MYPARAM1');
//$item->defaultFieldValue = 'default value';
// Setup conf WEBPORTAL_MYPARAM2 as a simple textarea input but we replace the text of field title
//$item = $formSetup->newItem('WEBPORTAL_MYPARAM2');
//$item->nameText = $item->getNameText().' more html text ';
// Setup conf WEBPORTAL_MYPARAM3
//$item = $formSetup->newItem('WEBPORTAL_MYPARAM3');
//$item->setAsThirdpartyType();
// Setup conf WEBPORTAL_MYPARAM4 : exemple of quick define write style
//$formSetup->newItem('WEBPORTAL_MYPARAM4')->setAsYesNo();
// Setup conf WEBPORTAL_MYPARAM5
//$formSetup->newItem('WEBPORTAL_MYPARAM5')->setAsEmailTemplate('thirdparty');
// Setup conf WEBPORTAL_MYPARAM6
//$formSetup->newItem('WEBPORTAL_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
// Setup conf WEBPORTAL_MYPARAM7
//$formSetup->newItem('WEBPORTAL_MYPARAM7')->setAsProduct();
//$formSetup->newItem('Title')->setAsTitle();
// Setup conf WEBPORTAL_MYPARAM8
//$item = $formSetup->newItem('WEBPORTAL_MYPARAM8');
//$TField = array(
// 'test01' => $langs->trans('test01'),
// 'test02' => $langs->trans('test02'),
// 'test03' => $langs->trans('test03'),
// 'test04' => $langs->trans('test04'),
// 'test05' => $langs->trans('test05'),
// 'test06' => $langs->trans('test06'),
//);
//$item->setAsMultiSelect($TField);
//$item->helpText = $langs->transnoentities('WEBPORTAL_MYPARAM8');
// Setup conf WEBPORTAL_MYPARAM9
//$formSetup->newItem('WEBPORTAL_MYPARAM9')->setAsSelect($TField);
// Setup conf WEBPORTAL_MYPARAM10
//$item = $formSetup->newItem('WEBPORTAL_MYPARAM10');
//$item->setAsColor();
//$item->defaultFieldValue = '#FF0000';
//$item->nameText = $item->getNameText().' more html text ';
//$item->fieldInputOverride = '';
//$item->helpText = $langs->transnoentities('AnHelpMessage');
//$item->fieldValue = '';
//$item->fieldAttr = array() ; // fields attribute only for compatible fields like input text
//$item->fieldOverride = false; // set this var to override field output will override $fieldInputOverride and $fieldOutputOverride too
//$item->fieldInputOverride = false; // set this var to override field input
//$item->fieldOutputOverride = false; // set this var to override field output
$setupnotempty += count($formSetup->items);
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
/*
* Actions
*/
// For retrocompatibility Dolibarr < 15.0
if (versioncompare(explode('.', DOL_VERSION), array(15)) < 0 && $action == 'update' && !empty($user->admin)) {
$formSetup->saveConfFromPost();
}
include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php';
/*
* View
*/
$form = new Form($db);
$help_url = '';
$page_name = "WebPortalSetup";
llxHeader('', $langs->trans($page_name), $help_url);
// Subheader
$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
// Configuration header
$head = webportalAdminPrepareHead();
print dol_get_fiche_head($head, 'themesettings', $langs->trans($page_name), -1, "webportal@webportal");
// Setup page goes here
echo '<span class="opacitymedium">' . $langs->trans("WebPortalSetupPage") . ' : ' . $langs->trans('UserAccountForWebPortalAreInThirdPartyTabHelp') .'</span>.<br><br>';
if ($action == 'edit') {
print $formSetup->generateOutput(true);
print '<br>';
} elseif (!empty($formSetup->items)) {
print $formSetup->generateOutput();
print '<div class="tabsAction">';
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&token=' . newToken() . '">' . $langs->trans("Modify") . '</a>';
print '</div>';
} else {
print '<br>' . $langs->trans("NothingToSetup");
}
// Page end
print dol_get_fiche_end();
llxFooter();
$db->close();

View File

@@ -81,7 +81,7 @@ class modWebPortal extends DolibarrModules
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
// To use a supported fa-xxx css style of font awesome, use this->picto='xxx'
$this->picto = 'fa-file-o';
$this->picto = 'fa-door-open_fa_#6c6aa8';
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
$this->module_parts = array(

View File

@@ -31,6 +31,7 @@ Settings = Settings
WebPortalSetupPage = WebPortal setup page
WEBPORTAL_ROOT_URL = Public access url
WebPortalRootUrlHelp = Public access url (http or https) if you have a virtual host or keep empty
UserAccountForWebPortalAreInThirdPartyTabHelp = Users accounts for WebPortal can be set on each third party card in Website accounts tab
WebPortalAccessHidden = Hidden
WebPortalAccessVisible = Visible
WebPortalAccessEdit = Editable
@@ -67,6 +68,18 @@ WebPortalMemberCardDesc = Member card
WebPortalPartnershipCardMenu = Partnership
WebPortalPartnershipCardTitle = Partnership card
WebPortalPartnershipCardDesc = Partnership card
loginWebportalUserName = User name / email
loginWebportalPassword = Password
LoginNow = Login now
RemoveSearchFilters = Remove search filters
#
# Aria accessibility
#
AriaPrevPage = Previous page
AriaNextPage = Next page
AriaPageX = Page %s
#
# Errors
@@ -80,3 +93,16 @@ WebPortalErrorFetchLoggedUser = Error when loading user (Id : %s)
WebPortalErrorFetchLoggedThirdParty = Error when loading third-party (Id : %s)
WebPortalErrorFetchLoggedMember = Error when loading member (Id : %s)
WebPortalErrorFetchLoggedPartnership = Error when loading partnership (Third-party Id : %s, Member Id : %s)
#
# Color theme settings
#
WEBPORTAL_PRIMARY_COLOR = Primary color
WEBPORTAL_SECONDARY_COLOR = Secondary color
WEBPORTAL_LOGIN_LOGO_URL = Login logo image URL
WEBPORTAL_MENU_LOGO_URL = Menu logo image URL
WEBPORTAL_MENU_LOGO_URLTooltip = Leave empty to use login logo
WEBPORTAL_LOGIN_BACKGROUND = Background login image URL
WEBPORTAL_BANNER_BACKGROUND = Background for banner
WEBPORTAL_BANNER_BACKGROUND_IS_DARK = Use dark theme for banner

View File

@@ -45,6 +45,11 @@ function webportalAdminPrepareHead()
$head[$h][2] = 'settings';
$h++;
$head[$h][0] = dol_buildpath("/webportal/admin/setup_theme.php", 1);
$head[$h][1] = $langs->trans("SkinAndColors");
$head[$h][2] = 'themesettings';
$h++;
$head[$h][0] = dol_buildpath("/webportal/admin/configcss.php", 1);
$head[$h][1] = $langs->trans("CSSPage");
$head[$h][2] = 'css';

View File

@@ -1,6 +1,7 @@
<?php
require_once __DIR__ . '/controller.class.php';
require_once __DIR__ . '/webPortalTheme.class.php';
/**
* Class Context
@@ -62,7 +63,7 @@ class Context
public $eventMessages = array();
public $tokenKey = 'ctoken';
public $tokenKey = 'token';
/**
* Curent object of page
@@ -91,6 +92,12 @@ class Context
public $logged_partnership = null;
/**
* @var WebPortalTheme Theme data
*/
public $theme;
/**
* Constructor
*
@@ -125,6 +132,9 @@ class Context
// Init de l'url de base
$this->rootUrl = self::getRootConfigUrl();
$this->theme = new WebPortalTheme();
}
/**

View File

@@ -186,6 +186,8 @@ class Controller
return false;
}
$controller = $this; // transmit controller to tpl
include $tplPath;
return true;

View File

@@ -433,17 +433,14 @@ class FormListWebPortal
$html .= '<ul>';
$html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>';
$html .= '</ul>';
$html .= '<ul>';
//$html .= '<li>'.$limit.'</li>';
$html .= '<li>';
$html .= '<a href="' . $url_file . $pagination_param . '&page=' . ($page - 1) . '" role="button"' . ($page <= 1 ? ' disabled' : '') . '> < </a>';
$html .= ' <a href="#"><strong>' . $page . '</strong></a> <a href="#">/</a> <a href="' . $url_file . $pagination_param . '&page=' . $nbpages . '">' . $nbpages . '</a> ';
$html .= '<a href="' . $url_file . $pagination_param . '&page=' . ($page + 1) . '" role="button"' . ($page >= $nbpages ? ' disabled' : '') . '> > </a>';
$html .= '</ul>';
/* Generate pagination list */
$html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page);
$html .= '</nav>';
// table with search filters and column titles
$html .= '<table id="webportal-' . $elementEn . '-list" role="grid">';
$html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">';
// title and desc for table
//if ($titleKey != '') {
// $html .= '<caption id="table-collapse-responsive">';
@@ -461,14 +458,14 @@ class FormListWebPortal
$html .= '<tr role="search-row">';
// Action column
// if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$html .= '<td>';
$html .= '<button type="submit" class="contrast" name="button_search_x" value="x"><span>?</span></button>';
$html .= '<button type="submit" class="contrast" name="button_removefilter_x" value="x"><span>X</span></button>';
$html .= '<td data-col="row-checkbox" >';
$html .= ' <button class="btn-filter-icon btn-search-filters-icon" type="submit" name="button_search_x" value="x" aria-label="'.dol_escape_htmltag($langs->trans('Search')).'" ></button>';
$html .= ' <button class="btn-filter-icon btn-remove-search-filters-icon" type="submit" name="button_removefilter_x" value="x" aria-label="'.dol_escape_htmltag($langs->trans('RemoveSearchFilters')).'"></button>';
$html .= '</td>';
// }
foreach ($object->fields as $key => $val) {
if (!empty($arrayfields['t.' . $key]['checked'])) {
$html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '">';
$html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
$html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', '');
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
@@ -512,7 +509,7 @@ class FormListWebPortal
$html .= '<tr>';
// Action column
// if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$html .= '<th></th>';
$html .= '<th data-col="row-checkbox" ></th>';
$totalarray['nbfield']++;
// }
foreach ($object->fields as $key => $val) {
@@ -523,7 +520,7 @@ class FormListWebPortal
$tableOrder = strtolower($sortList[$tableKey]);
}
$url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param;
$html .= '<th scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>';
$html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>';
$html .= '<a href="' . $url_param . '">';
$html .= $langs->trans($arrayfields['t.' . $key]['label']);
$html .= '</a>';
@@ -729,4 +726,53 @@ class FormListWebPortal
return $html;
}
/**
* @param string $url url of curent page
* @param int $nbPages total of pages results
* @param int $currentPage number of current page
* @return string
*/
public static function generatePageListNav(string $url, int $nbPages, int $currentPage){
global $langs;
$pSep = strpos($url, '?') === false ? '?' : '&amp;';
$html = '<ul class="pages-nav-list">';
if($currentPage > 1){
$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>';
}
$maxPaginItem = min($nbPages, 5);
$minPageNum = max(1, $currentPage-3);
$maxPageNum = min($nbPages, $currentPage+3);
if($minPageNum > 1){
$html .= '<li><a class="pages-nav-list__link '.($currentPage==1?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="' . $url . $pSep . 'page=1" >1</a></li>';
$html .= '<li>&hellip;</li>';
}
for($p=$minPageNum; $p <= $maxPageNum; $p++){
$html .= '<li><a class="pages-nav-list__link '.($currentPage===$p?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>';
}
if($maxPaginItem<$nbPages){
$html .= '<li>&hellip;</li>';
$html .= '<li><a class="pages-nav-list__link '.($currentPage==$nbPages?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>';
}
if($currentPage < $nbPages) {
$html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="' . $url . $pSep . 'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>';
}
$html .= '</ul>';
return $html;
}
}

View File

@@ -0,0 +1,150 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Lionel Vessiller <lvessiller@open-dsi.fr>
* Copyright (C) 2023 John Botella <john.botella@atm-consulting.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/webportal/public/class/webPortalTheme.class.php
* \ingroup webportal
* \brief File of class with theme definition for WebPortal
*/
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; // used for color functions
class WebPortalTheme{
public $primaryColorHex = '#263c5c';
public $primaryColorHsl = array(
'h' => 216, // Hue
'l' => 42, // lightness
's' => 25, // Saturation
'a' => 1 // Alfa
);
public $loginLogoUrl;
public $menuLogoUrl;
public $loginBackground;
public function __construct() {
$this->loadPrimaryColor();
$this->loginLogoUrl = getDolGlobalString('WEBPORTAL_LOGIN_LOGO_URL');
$this->menuLogoUrl = getDolGlobalString('WEBPORTAL_MENU_LOGO_URL',$this->loginLogoUrl);
$this->loginBackground = getDolGlobalString('WEBPORTAL_LOGIN_BACKGROUND');
$this->bannerBackground = getDolGlobalString('WEBPORTAL_BANNER_BACKGROUND');
$this->bannerUseDarkTheme = getDolGlobalInt('WEBPORTAL_BANNER_BACKGROUND_IS_DARK');
}
/**
* return hex of primary theme color
*
* @return string
*/
public function loadPrimaryColor(){
global $conf;
$outColor = '';
if(!empty($conf->global->WEBPORTAL_PRIMARY_COLOR)){
$outColor = $conf->global->WEBPORTAL_PRIMARY_COLOR;
}elseif(!empty($conf->global->THEME_ELDY_TOPMENU_BACK1)){
$outColor = '#'.colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1));
}
if(empty($outColor) || !colorValidateHex($outColor)){
$outColor = '#263c5c';
}
$this->primaryColorHex = $outColor;
$this->primaryColorHsl = $this->colorHexToHsl($outColor, true, true);
}
/**
* @param string $hex color in hex
* @param float|false $alpha 0 to 1 to add alpha channel
* @param bool $returnArray true=return an array instead, false=return string
* @return string|array String or array
*/
function colorHexToHsl($hex, $alpha = false, $returnArray = false)
{
if(function_exists('colorHexToHsl')){
return colorHexToHsl($hex, $alpha, $returnArray);
}
// For retro compatibility
// TODO : Remove this when webportal is included in DOLIBARR standard
$hex = str_replace('#', '', $hex);
$red = hexdec(substr($hex, 0, 2)) / 255;
$green = hexdec(substr($hex, 2, 2)) / 255;
$blue = hexdec(substr($hex, 4, 2)) / 255;
$cmin = min($red, $green, $blue);
$cmax = max($red, $green, $blue);
$delta = $cmax - $cmin;
if ($delta == 0) {
$hue = 0;
} elseif ($cmax === $red) {
$hue = (($green - $blue) / $delta);
} elseif ($cmax === $green) {
$hue = ($blue - $red) / $delta + 2;
} else {
$hue = ($red - $green) / $delta + 4;
}
$hue = round($hue * 60);
if ($hue < 0) {
$hue += 360;
}
$lightness = (($cmax + $cmin) / 2);
$saturation = $delta === 0 ? 0 : ($delta / (1 - abs(2 * $lightness - 1)));
if ($saturation < 0) {
$saturation += 1;
}
$lightness = round($lightness*100);
$saturation = round($saturation*100);
if ($returnArray) {
return array(
'h' => $hue,
'l' => $lightness,
's' => $saturation,
'a' => $alpha === false ? 1 : $alpha
);
}
else if($alpha){
return 'hsla('.$hue.', '.$saturation.', '.$lightness.' / '.$alpha.')';
}
else {
return 'hsl('.$hue.', '.$saturation.', '.$lightness.')';
}
}
}

View File

@@ -54,6 +54,7 @@ class DefaultController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();

View File

@@ -97,6 +97,7 @@ class InvoiceListController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {

View File

@@ -104,6 +104,7 @@ class MemberCardController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {

View File

@@ -97,6 +97,7 @@ class OrderListController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {

View File

@@ -104,6 +104,7 @@ class PartnershipCardController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {

View File

@@ -100,6 +100,7 @@ class PropalListController extends Controller
$this->loadTemplate('header');
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {

View File

@@ -1,9 +1,13 @@
@charset "UTF-8";
@import "pico.css";
@import "mixin.css";
@import "login.css";
@import "./themes/custom.css.php";
/**
This file car overwrite default pico css
*/
/**
@@ -18,11 +22,28 @@ body > nav {
top: 0;
right: 0;
left: 0;
backdrop-filter: saturate(180%) blur(10px);
backdrop-filter: blur(60px) ;
background-color: var(--nav-background-color);
box-shadow: 0px 1px 0 var(--nav-border-color);
}
.primary-top-nav{
--border-radius: 0;
}
/**
NAV BRAND LOGO
*/
.brand__logo-link{
max-height: 100%;
margin: 0;
padding: 0;
}
.brand__logo-link:focus{
background: none;
}
.spacer{
--spacer-margin: calc(var(--font-size) * 2);
margin-top: var(--spacer-margin);
@@ -36,3 +57,89 @@ html{
#main-container{
padding-top: 200px;
}
.pages-nav-list__icon::after {
display: block;
width: 1rem;
height: 1rem;
-webkit-margin-start: calc(var(--spacing, 1rem) * 0.5);
margin-inline-start: calc(var(--spacing, 1rem) * 0.5);
float: right;
background-image: var(--icon-chevron);
background-position: right center;
background-size: 1rem auto;
background-repeat: no-repeat;
content: "";
transition: transform var(--transition);
}
.pages-nav-list__icon.--prev::after {
transform: rotate(90deg);
}
.pages-nav-list__icon.--next::after {
transform: rotate(-90deg);
}
.pages-nav-list__link.--active{
outline: 1px solid hsla(var(--primary-color-hue), var(--primary-color-saturation), var(--primary-color-lightness), 0.3);
}
.hero-header{
background-color: #f2f2f2;
background-image: var(--banner-background);
padding: 120px 0 64px 0;
margin: 0;
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}
/**
Search list
*/
[role="search-row"] :is(button, input[type=submit], input[type=button], [role=button]) {
--background-color: #ededed;
--border-color: #ededed;
--color: #666;
}
.btn-filter-icon{
--icon-url : var(--icon-time);
--icon-size : 16px;
display: inline-block;
width: auto;
}
.btn-filter-icon::before{
content: " ";
display: inline-block;
height: var(--icon-size);
width: var(--icon-size);
background-color: transparent;
background-image: var(--icon-url);
background-repeat: no-repeat;
background-size: var(--icon-size) var(--icon-size);
background-position: center;
}
.btn-filter-icon.btn-remove-search-filters-icon::before {
--icon-url : var(--icon-close);
}
.btn-filter-icon.btn-search-filters-icon::before {
--icon-url : var(--icon-search);
}
[role="search-row"] [data-col="row-checkbox"]{
white-space: nowrap;
}
/**
Home Styles
*/
.home-links-card{
}

View File

@@ -209,8 +209,7 @@ kbd {
--font-weight: bolder;
}
[data-theme=light],
:root:not([data-theme=dark]) {
:where(:root) {
--background-color: #fff;
--color: hsl(205, 20%, 32%);
--h1-color: hsl(205, 30%, 15%);
@@ -222,12 +221,13 @@ kbd {
--muted-color: hsl(205, 10%, 50%);
--muted-border-color: hsl(205, 20%, 94%);
--banner-background : #ededed;
--primary-color-hue : 200;
--primary-color-saturation : 45%;
--primary-color-lightness : 50%;
--primary : hsl(var(--primary-color-hue), var(--primary-color-saturation), var(--primary-color-lightness));
--primary-hover: hsl(var(--primary-color-hue), 90%, 32%);
--primary-focus: rgba(16, 149, 193, 0.125);
--primary-focus: hsl(var(--primary-color-hue), var(--primary-color-saturation), var(--primary-color-lightness), 0.125);
--primary-inverse: #fff;
--secondary: hsl(205, 15%, 41%);
--secondary-hover: hsl(205, 20%, 32%);
@@ -305,12 +305,13 @@ kbd {
--loading-spinner-opacity: 0.5;
--tooltip-background-color: var(--contrast);
--tooltip-color: var(--contrast-inverse);
/** SVG Images */
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='-96 0 10.24 10.24' style='fill:rgba(65, 84, 98)'%3E%3Cpath d='M-96 1.92h10.24l-5.12 6.4z' /%3E%3C/svg%3E");
--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
--icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
--icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(198, 40, 40)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
@@ -319,8 +320,8 @@ kbd {
--icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
--icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(56, 142, 60)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--nav-background-color: rgba(255,255,255,0.3);
--nav-border-color: var(--table-border-color);
--nav-background-color: rgba(255,255,255,0.8);
--nav-border-color: rgba(127,127,127,0.3);
color-scheme: light;
@@ -445,111 +446,115 @@ kbd {
/* color-scheme: dark;*/
/* }*/
/*}*/
/*[data-theme=dark] {*/
/* --background-color: #11191f;*/
/* --color: hsl(205, 16%, 77%);*/
/* --h1-color: hsl(205, 20%, 94%);*/
/* --h2-color: #e1e6eb;*/
/* --h3-color: hsl(205, 18%, 86%);*/
/* --h4-color: #c8d1d8;*/
/* --h5-color: hsl(205, 16%, 77%);*/
/* --h6-color: #afbbc4;*/
/* --muted-color: hsl(205, 10%, 50%);*/
/* --muted-border-color: #1f2d38;*/
[data-theme=dark] {
--background-color: #11191f;
--color: hsl(205, 16%, 77%);
--h1-color: hsl(205, 20%, 94%);
--h2-color: #e1e6eb;
--h3-color: hsl(205, 18%, 86%);
--h4-color: #c8d1d8;
--h5-color: hsl(205, 16%, 77%);
--h6-color: #afbbc4;
--muted-color: hsl(205, 10%, 50%);
--muted-border-color: #1f2d38;
/*--primary: hsl(195, 85%, 41%);*/
/*--primary-hover: hsl(195, 80%, 50%);*/
/*--primary-focus: rgba(16, 149, 193, 0.25);*/
/*--primary-inverse: #fff;*/
/* --secondary: hsl(205, 15%, 41%);*/
/* --secondary-hover: hsl(205, 10%, 50%);*/
/* --secondary-focus: rgba(115, 130, 140, 0.25);*/
/* --secondary-inverse: #fff;*/
/* --contrast: hsl(205, 20%, 94%);*/
/* --contrast-hover: #fff;*/
/* --contrast-focus: rgba(115, 130, 140, 0.25);*/
/* --contrast-inverse: #000;*/
/* --mark-background-color: #d1c284;*/
/* --mark-color: #11191f;*/
/* --ins-color: #388e3c;*/
/* --del-color: #c62828;*/
/* --blockquote-border-color: var(--muted-border-color);*/
/* --blockquote-footer-color: var(--muted-color);*/
/* --button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);*/
/* --button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);*/
/* --form-element-background-color: #11191f;*/
/* --form-element-border-color: #374956;*/
/* --form-element-color: var(--color);*/
/* --form-element-placeholder-color: var(--muted-color);*/
/* --form-element-active-background-color: var(--form-element-background-color);*/
/* --form-element-active-border-color: var(--primary);*/
/* --form-element-focus-color: var(--primary-focus);*/
/* --form-element-disabled-background-color: hsl(205, 25%, 23%);*/
/* --form-element-disabled-border-color: hsl(205, 20%, 32%);*/
/* --form-element-disabled-opacity: 0.5;*/
/* --form-element-invalid-border-color: #b71c1c;*/
/* --form-element-invalid-active-border-color: #c62828;*/
/* --form-element-invalid-focus-color: rgba(198, 40, 40, 0.25);*/
/* --form-element-valid-border-color: #2e7d32;*/
/* --form-element-valid-active-border-color: #388e3c;*/
/* --form-element-valid-focus-color: rgba(56, 142, 60, 0.25);*/
/* --switch-background-color: #374956;*/
/* --switch-color: var(--primary-inverse);*/
/* --switch-checked-background-color: var(--primary);*/
/* --range-border-color: #24333e;*/
/* --range-active-border-color: hsl(205, 25%, 23%);*/
/* --range-thumb-border-color: var(--background-color);*/
/* --range-thumb-color: var(--secondary);*/
/* --range-thumb-hover-color: var(--secondary-hover);*/
/* --range-thumb-active-color: var(--primary);*/
/* --table-border-color: var(--muted-border-color);*/
/* --table-row-stripped-background-color: rgba(115, 130, 140, 0.05);*/
/* --code-background-color: #18232c;*/
/* --code-color: var(--muted-color);*/
/* --code-kbd-background-color: var(--contrast);*/
/* --code-kbd-color: var(--contrast-inverse);*/
/* --code-tag-color: hsl(330, 30%, 50%);*/
/* --code-property-color: hsl(185, 30%, 50%);*/
/* --code-value-color: hsl(40, 10%, 50%);*/
/* --code-comment-color: #4d606d;*/
/* --accordion-border-color: var(--muted-border-color);*/
/* --accordion-active-summary-color: var(--primary);*/
/* --accordion-close-summary-color: var(--color);*/
/* --accordion-open-summary-color: var(--muted-color);*/
/* --card-background-color: #141e26;*/
/* --card-border-color: var(--card-background-color);*/
/* --card-box-shadow:*/
/* 0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),*/
/* 0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),*/
/* 0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),*/
/* 0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),*/
/* 0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),*/
/* 0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),*/
/* 0 0 0 0.0625rem rgba(0, 0, 0, 0.015);*/
/* --card-sectionning-background-color: #18232c;*/
/* --dropdown-background-color: hsl(205, 30%, 15%);*/
/* --dropdown-border-color: #24333e;*/
/* --dropdown-box-shadow: var(--card-box-shadow);*/
/* --dropdown-color: var(--color);*/
/* --dropdown-hover-background-color: rgba(36, 51, 62, 0.75);*/
/* --modal-overlay-background-color: rgba(36, 51, 62, 0.8);*/
/* --progress-background-color: #24333e;*/
/* --progress-color: var(--primary);*/
/* --loading-spinner-opacity: 0.5;*/
/* --tooltip-background-color: var(--contrast);*/
/* --tooltip-color: var(--contrast-inverse);*/
/* --icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");*/
/* --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");*/
/* --icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");*/
/* --icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");*/
/* --icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");*/
/* --icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");*/
/* --icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");*/
/* --icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");*/
/* --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");*/
/* --icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");*/
/* --icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");*/
/* color-scheme: dark;*/
/*}*/
--secondary: hsl(205, 15%, 41%);
--secondary-hover: hsl(205, 10%, 50%);
--secondary-focus: rgba(115, 130, 140, 0.25);
--secondary-inverse: #fff;
--contrast: hsl(205, 20%, 94%);
--contrast-hover: #fff;
--contrast-focus: rgba(115, 130, 140, 0.25);
--contrast-inverse: #000;
--mark-background-color: #d1c284;
--mark-color: #11191f;
--ins-color: #388e3c;
--del-color: #c62828;
--blockquote-border-color: var(--muted-border-color);
--blockquote-footer-color: var(--muted-color);
--button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--form-element-background-color: #11191f;
--form-element-border-color: #374956;
--form-element-color: var(--color);
--form-element-placeholder-color: var(--muted-color);
--form-element-active-background-color: var(--form-element-background-color);
--form-element-active-border-color: var(--primary);
--form-element-focus-color: var(--primary-focus);
--form-element-disabled-background-color: hsl(205, 25%, 23%);
--form-element-disabled-border-color: hsl(205, 20%, 32%);
--form-element-disabled-opacity: 0.5;
--form-element-invalid-border-color: #b71c1c;
--form-element-invalid-active-border-color: #c62828;
--form-element-invalid-focus-color: rgba(198, 40, 40, 0.25);
--form-element-valid-border-color: #2e7d32;
--form-element-valid-active-border-color: #388e3c;
--form-element-valid-focus-color: rgba(56, 142, 60, 0.25);
--switch-background-color: #374956;
--switch-color: var(--primary-inverse);
--switch-checked-background-color: var(--primary);
--range-border-color: #24333e;
--range-active-border-color: hsl(205, 25%, 23%);
--range-thumb-border-color: var(--background-color);
--range-thumb-color: var(--secondary);
--range-thumb-hover-color: var(--secondary-hover);
--range-thumb-active-color: var(--primary);
--table-border-color: var(--muted-border-color);
--table-row-stripped-background-color: rgba(115, 130, 140, 0.05);
--code-background-color: #18232c;
--code-color: var(--muted-color);
--code-kbd-background-color: var(--contrast);
--code-kbd-color: var(--contrast-inverse);
--code-tag-color: hsl(330, 30%, 50%);
--code-property-color: hsl(185, 30%, 50%);
--code-value-color: hsl(40, 10%, 50%);
--code-comment-color: #4d606d;
--accordion-border-color: var(--muted-border-color);
--accordion-active-summary-color: var(--primary);
--accordion-close-summary-color: var(--color);
--accordion-open-summary-color: var(--muted-color);
--card-background-color: #141e26;
--card-border-color: var(--card-background-color);
--card-box-shadow:
0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),
0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),
0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),
0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),
0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),
0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),
0 0 0 0.0625rem rgba(0, 0, 0, 0.015);
--card-sectionning-background-color: #18232c;
--dropdown-background-color: hsl(205, 30%, 15%);
--dropdown-border-color: #24333e;
--dropdown-box-shadow: var(--card-box-shadow);
--dropdown-color: var(--color);
--dropdown-hover-background-color: rgba(36, 51, 62, 0.75);
--modal-overlay-background-color: rgba(36, 51, 62, 0.8);
--progress-background-color: #24333e;
--progress-color: var(--primary);
--loading-spinner-opacity: 0.5;
--tooltip-background-color: var(--contrast);
--tooltip-color: var(--contrast-inverse);
/** SVG Images */
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
--icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
--icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
--icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
--icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
--icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
color-scheme: dark;
}
progress,
[type=checkbox],

View File

@@ -22,8 +22,7 @@ if (!defined('NOREQUIREAJAX')) {
session_cache_limiter('public');
// require_once __DIR__.'/../main.inc.php';
// require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once __DIR__.'/../../../webportal.main.inc.php';
// Define css type
// top_httphead('text/css');
@@ -39,5 +38,30 @@ header("X-Frame-Options: SAMEORIGIN");
} */
require_once __DIR__ . '/../../class/webPortalTheme.class.php';
$webPortalTheme = new WebPortalTheme();
?>
[data-theme="custom"], :root{
--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' ?>);
}
.login-page {
<?php
if(!empty($webPortalTheme->loginBackground)){
print '--login-background: rgba(0, 0, 0, 0.4) url("'.$webPortalTheme->loginBackground.'");'."\n";
}
if(!empty($webPortalTheme->loginLogoUrl)){
print '--login-logo: url("'.$webPortalTheme->loginLogoUrl.'"); /* for relative path, must be relative od the css file or use full url starting by http:// */'."\n";
}
?>
}
<?php
print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS'."*/\n";
print getDolGlobalString('WEBPORTAL_CUSTOM_CSS');

View File

@@ -1,526 +0,0 @@
/**
* Theme: default
*/
:root {
--font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu",
"Cantarell", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
--line-height: 1.5;
--font-weight: 400;
--font-size: 16px;
--border-radius: 0.25rem;
--border-width: 1px;
--outline-width: 3px;
--spacing: 1rem;
--typography-spacing-vertical: 1.5rem;
--block-spacing-vertical: calc(var(--spacing) * 2);
--block-spacing-horizontal: var(--spacing);
--grid-spacing-vertical: 0;
--grid-spacing-horizontal: var(--spacing);
--form-element-spacing-vertical: 0.75rem;
--form-element-spacing-horizontal: 1rem;
--nav-element-spacing-vertical: 1rem;
--nav-element-spacing-horizontal: 0.5rem;
--nav-link-spacing-vertical: 0.5rem;
--nav-link-spacing-horizontal: 0.5rem;
--form-label-font-weight: var(--font-weight);
--transition: 0.2s ease-in-out;
--modal-overlay-backdrop-filter: blur(0.25rem);
}
@media (min-width: 576px) {
:root {
--font-size: 17px;
}
}
@media (min-width: 768px) {
:root {
--font-size: 18px;
}
}
@media (min-width: 992px) {
:root {
--font-size: 19px;
}
}
@media (min-width: 1200px) {
:root {
--font-size: 20px;
}
}
@media (min-width: 576px) {
body > header,
body > main,
body > footer,
section {
--block-spacing-vertical: calc(var(--spacing) * 2.5);
}
}
@media (min-width: 768px) {
body > header,
body > main,
body > footer,
section {
--block-spacing-vertical: calc(var(--spacing) * 3);
}
}
@media (min-width: 992px) {
body > header,
body > main,
body > footer,
section {
--block-spacing-vertical: calc(var(--spacing) * 3.5);
}
}
@media (min-width: 1200px) {
body > header,
body > main,
body > footer,
section {
--block-spacing-vertical: calc(var(--spacing) * 4);
}
}
@media (min-width: 576px) {
article {
--block-spacing-horizontal: calc(var(--spacing) * 1.25);
}
}
@media (min-width: 768px) {
article {
--block-spacing-horizontal: calc(var(--spacing) * 1.5);
}
}
@media (min-width: 992px) {
article {
--block-spacing-horizontal: calc(var(--spacing) * 1.75);
}
}
@media (min-width: 1200px) {
article {
--block-spacing-horizontal: calc(var(--spacing) * 2);
}
}
dialog > article {
--block-spacing-vertical: calc(var(--spacing) * 2);
--block-spacing-horizontal: var(--spacing);
}
@media (min-width: 576px) {
dialog > article {
--block-spacing-vertical: calc(var(--spacing) * 2.5);
--block-spacing-horizontal: calc(var(--spacing) * 1.25);
}
}
@media (min-width: 768px) {
dialog > article {
--block-spacing-vertical: calc(var(--spacing) * 3);
--block-spacing-horizontal: calc(var(--spacing) * 1.5);
}
}
a {
--text-decoration: none;
}
a.secondary, a.contrast {
--text-decoration: underline;
}
small {
--font-size: 0.875em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
--font-weight: 700;
}
h1 {
--font-size: 2rem;
--typography-spacing-vertical: 3rem;
}
h2 {
--font-size: 1.75rem;
--typography-spacing-vertical: 2.625rem;
}
h3 {
--font-size: 1.5rem;
--typography-spacing-vertical: 2.25rem;
}
h4 {
--font-size: 1.25rem;
--typography-spacing-vertical: 1.874rem;
}
h5 {
--font-size: 1.125rem;
--typography-spacing-vertical: 1.6875rem;
}
[type=checkbox],
[type=radio] {
--border-width: 2px;
}
[type=checkbox][role=switch] {
--border-width: 3px;
}
thead th,
thead td,
tfoot th,
tfoot td {
--border-width: 3px;
}
:not(thead, tfoot) > * > td {
--font-size: 0.875em;
}
pre,
code,
kbd,
samp {
--font-family: "Menlo", "Consolas", "Roboto Mono", "Ubuntu Monospace",
"Noto Mono", "Oxygen Mono", "Liberation Mono", monospace,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
kbd {
--font-weight: bolder;
}
[data-theme=light],
:root:not([data-theme=dark]) {
--background-color: #fff;
--color: hsl(205, 20%, 32%);
--h1-color: hsl(205, 30%, 15%);
--h2-color: #24333e;
--h3-color: hsl(205, 25%, 23%);
--h4-color: #374956;
--h5-color: hsl(205, 20%, 32%);
--h6-color: #4d606d;
--muted-color: hsl(205, 10%, 50%);
--muted-border-color: hsl(205, 20%, 94%);
--primary: hsl(195, 85%, 41%);
--primary-hover: hsl(195, 90%, 32%);
--primary-focus: rgba(16, 149, 193, 0.125);
--primary-inverse: #fff;
--secondary: hsl(205, 15%, 41%);
--secondary-hover: hsl(205, 20%, 32%);
--secondary-focus: rgba(89, 107, 120, 0.125);
--secondary-inverse: #fff;
--contrast: hsl(205, 30%, 15%);
--contrast-hover: #000;
--contrast-focus: rgba(89, 107, 120, 0.125);
--contrast-inverse: #fff;
--mark-background-color: #fff2ca;
--mark-color: #543a26;
--ins-color: #388e3c;
--del-color: #c62828;
--blockquote-border-color: var(--muted-border-color);
--blockquote-footer-color: var(--muted-color);
--button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--form-element-background-color: transparent;
--form-element-border-color: hsl(205, 14%, 68%);
--form-element-color: var(--color);
--form-element-placeholder-color: var(--muted-color);
--form-element-active-background-color: transparent;
--form-element-active-border-color: var(--primary);
--form-element-focus-color: var(--primary-focus);
--form-element-disabled-background-color: hsl(205, 18%, 86%);
--form-element-disabled-border-color: hsl(205, 14%, 68%);
--form-element-disabled-opacity: 0.5;
--form-element-invalid-border-color: #c62828;
--form-element-invalid-active-border-color: #d32f2f;
--form-element-invalid-focus-color: rgba(211, 47, 47, 0.125);
--form-element-valid-border-color: #388e3c;
--form-element-valid-active-border-color: #43a047;
--form-element-valid-focus-color: rgba(67, 160, 71, 0.125);
--switch-background-color: hsl(205, 16%, 77%);
--switch-color: var(--primary-inverse);
--switch-checked-background-color: var(--primary);
--range-border-color: hsl(205, 18%, 86%);
--range-active-border-color: hsl(205, 16%, 77%);
--range-thumb-border-color: var(--background-color);
--range-thumb-color: var(--secondary);
--range-thumb-hover-color: var(--secondary-hover);
--range-thumb-active-color: var(--primary);
--table-border-color: var(--muted-border-color);
--table-row-stripped-background-color: #f6f8f9;
--code-background-color: hsl(205, 20%, 94%);
--code-color: var(--muted-color);
--code-kbd-background-color: var(--contrast);
--code-kbd-color: var(--contrast-inverse);
--code-tag-color: hsl(330, 40%, 50%);
--code-property-color: hsl(185, 40%, 40%);
--code-value-color: hsl(40, 20%, 50%);
--code-comment-color: hsl(205, 14%, 68%);
--accordion-border-color: var(--muted-border-color);
--accordion-close-summary-color: var(--color);
--accordion-open-summary-color: var(--muted-color);
--card-background-color: var(--background-color);
--card-border-color: var(--muted-border-color);
--card-box-shadow:
0.0145rem 0.029rem 0.174rem rgba(27, 40, 50, 0.01698),
0.0335rem 0.067rem 0.402rem rgba(27, 40, 50, 0.024),
0.0625rem 0.125rem 0.75rem rgba(27, 40, 50, 0.03),
0.1125rem 0.225rem 1.35rem rgba(27, 40, 50, 0.036),
0.2085rem 0.417rem 2.502rem rgba(27, 40, 50, 0.04302),
0.5rem 1rem 6rem rgba(27, 40, 50, 0.06),
0 0 0 0.0625rem rgba(27, 40, 50, 0.015);
--card-sectionning-background-color: #fbfbfc;
--dropdown-background-color: #fbfbfc;
--dropdown-border-color: #e1e6eb;
--dropdown-box-shadow: var(--card-box-shadow);
--dropdown-color: var(--color);
--dropdown-hover-background-color: hsl(205, 20%, 94%);
--modal-overlay-background-color: rgba(213, 220, 226, 0.7);
--progress-background-color: hsl(205, 18%, 86%);
--progress-color: var(--primary);
--loading-spinner-opacity: 0.5;
--tooltip-background-color: var(--contrast);
--tooltip-color: var(--contrast-inverse);
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
--icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
--icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(198, 40, 40)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
--icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
--icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
--icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(56, 142, 60)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
color-scheme: light;
}
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme]) {
--background-color: #11191f;
--color: hsl(205, 16%, 77%);
--h1-color: hsl(205, 20%, 94%);
--h2-color: #e1e6eb;
--h3-color: hsl(205, 18%, 86%);
--h4-color: #c8d1d8;
--h5-color: hsl(205, 16%, 77%);
--h6-color: #afbbc4;
--muted-color: hsl(205, 10%, 50%);
--muted-border-color: #1f2d38;
--primary: hsl(195, 85%, 41%);
--primary-hover: hsl(195, 80%, 50%);
--primary-focus: rgba(16, 149, 193, 0.25);
--primary-inverse: #fff;
--secondary: hsl(205, 15%, 41%);
--secondary-hover: hsl(205, 10%, 50%);
--secondary-focus: rgba(115, 130, 140, 0.25);
--secondary-inverse: #fff;
--contrast: hsl(205, 20%, 94%);
--contrast-hover: #fff;
--contrast-focus: rgba(115, 130, 140, 0.25);
--contrast-inverse: #000;
--mark-background-color: #d1c284;
--mark-color: #11191f;
--ins-color: #388e3c;
--del-color: #c62828;
--blockquote-border-color: var(--muted-border-color);
--blockquote-footer-color: var(--muted-color);
--button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--form-element-background-color: #11191f;
--form-element-border-color: #374956;
--form-element-color: var(--color);
--form-element-placeholder-color: var(--muted-color);
--form-element-active-background-color: var(--form-element-background-color);
--form-element-active-border-color: var(--primary);
--form-element-focus-color: var(--primary-focus);
--form-element-disabled-background-color: hsl(205, 25%, 23%);
--form-element-disabled-border-color: hsl(205, 20%, 32%);
--form-element-disabled-opacity: 0.5;
--form-element-invalid-border-color: #b71c1c;
--form-element-invalid-active-border-color: #c62828;
--form-element-invalid-focus-color: rgba(198, 40, 40, 0.25);
--form-element-valid-border-color: #2e7d32;
--form-element-valid-active-border-color: #388e3c;
--form-element-valid-focus-color: rgba(56, 142, 60, 0.25);
--switch-background-color: #374956;
--switch-color: var(--primary-inverse);
--switch-checked-background-color: var(--primary);
--range-border-color: #24333e;
--range-active-border-color: hsl(205, 25%, 23%);
--range-thumb-border-color: var(--background-color);
--range-thumb-color: var(--secondary);
--range-thumb-hover-color: var(--secondary-hover);
--range-thumb-active-color: var(--primary);
--table-border-color: var(--muted-border-color);
--table-row-stripped-background-color: rgba(115, 130, 140, 0.05);
--code-background-color: #18232c;
--code-color: var(--muted-color);
--code-kbd-background-color: var(--contrast);
--code-kbd-color: var(--contrast-inverse);
--code-tag-color: hsl(330, 30%, 50%);
--code-property-color: hsl(185, 30%, 50%);
--code-value-color: hsl(40, 10%, 50%);
--code-comment-color: #4d606d;
--accordion-border-color: var(--muted-border-color);
--accordion-active-summary-color: var(--primary);
--accordion-close-summary-color: var(--color);
--accordion-open-summary-color: var(--muted-color);
--card-background-color: #141e26;
--card-border-color: var(--card-background-color);
--card-box-shadow:
0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),
0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),
0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),
0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),
0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),
0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),
0 0 0 0.0625rem rgba(0, 0, 0, 0.015);
--card-sectionning-background-color: #18232c;
--dropdown-background-color: hsl(205, 30%, 15%);
--dropdown-border-color: #24333e;
--dropdown-box-shadow: var(--card-box-shadow);
--dropdown-color: var(--color);
--dropdown-hover-background-color: rgba(36, 51, 62, 0.75);
--modal-overlay-background-color: rgba(36, 51, 62, 0.8);
--progress-background-color: #24333e;
--progress-color: var(--primary);
--loading-spinner-opacity: 0.5;
--tooltip-background-color: var(--contrast);
--tooltip-color: var(--contrast-inverse);
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
--icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
--icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
--icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
--icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
--icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
color-scheme: dark;
}
}
[data-theme=dark] {
--background-color: #11191f;
--color: hsl(205, 16%, 77%);
--h1-color: hsl(205, 20%, 94%);
--h2-color: #e1e6eb;
--h3-color: hsl(205, 18%, 86%);
--h4-color: #c8d1d8;
--h5-color: hsl(205, 16%, 77%);
--h6-color: #afbbc4;
--muted-color: hsl(205, 10%, 50%);
--muted-border-color: #1f2d38;
--primary: hsl(195, 85%, 41%);
--primary-hover: hsl(195, 80%, 50%);
--primary-focus: rgba(16, 149, 193, 0.25);
--primary-inverse: #fff;
--secondary: hsl(205, 15%, 41%);
--secondary-hover: hsl(205, 10%, 50%);
--secondary-focus: rgba(115, 130, 140, 0.25);
--secondary-inverse: #fff;
--contrast: hsl(205, 20%, 94%);
--contrast-hover: #fff;
--contrast-focus: rgba(115, 130, 140, 0.25);
--contrast-inverse: #000;
--mark-background-color: #d1c284;
--mark-color: #11191f;
--ins-color: #388e3c;
--del-color: #c62828;
--blockquote-border-color: var(--muted-border-color);
--blockquote-footer-color: var(--muted-color);
--button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
--form-element-background-color: #11191f;
--form-element-border-color: #374956;
--form-element-color: var(--color);
--form-element-placeholder-color: var(--muted-color);
--form-element-active-background-color: var(--form-element-background-color);
--form-element-active-border-color: var(--primary);
--form-element-focus-color: var(--primary-focus);
--form-element-disabled-background-color: hsl(205, 25%, 23%);
--form-element-disabled-border-color: hsl(205, 20%, 32%);
--form-element-disabled-opacity: 0.5;
--form-element-invalid-border-color: #b71c1c;
--form-element-invalid-active-border-color: #c62828;
--form-element-invalid-focus-color: rgba(198, 40, 40, 0.25);
--form-element-valid-border-color: #2e7d32;
--form-element-valid-active-border-color: #388e3c;
--form-element-valid-focus-color: rgba(56, 142, 60, 0.25);
--switch-background-color: #374956;
--switch-color: var(--primary-inverse);
--switch-checked-background-color: var(--primary);
--range-border-color: #24333e;
--range-active-border-color: hsl(205, 25%, 23%);
--range-thumb-border-color: var(--background-color);
--range-thumb-color: var(--secondary);
--range-thumb-hover-color: var(--secondary-hover);
--range-thumb-active-color: var(--primary);
--table-border-color: var(--muted-border-color);
--table-row-stripped-background-color: rgba(115, 130, 140, 0.05);
--code-background-color: #18232c;
--code-color: var(--muted-color);
--code-kbd-background-color: var(--contrast);
--code-kbd-color: var(--contrast-inverse);
--code-tag-color: hsl(330, 30%, 50%);
--code-property-color: hsl(185, 30%, 50%);
--code-value-color: hsl(40, 10%, 50%);
--code-comment-color: #4d606d;
--accordion-border-color: var(--muted-border-color);
--accordion-active-summary-color: var(--primary);
--accordion-close-summary-color: var(--color);
--accordion-open-summary-color: var(--muted-color);
--card-background-color: #141e26;
--card-border-color: var(--card-background-color);
--card-box-shadow:
0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),
0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),
0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),
0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),
0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),
0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),
0 0 0 0.0625rem rgba(0, 0, 0, 0.015);
--card-sectionning-background-color: #18232c;
--dropdown-background-color: hsl(205, 30%, 15%);
--dropdown-border-color: #24333e;
--dropdown-box-shadow: var(--card-box-shadow);
--dropdown-color: var(--color);
--dropdown-hover-background-color: rgba(36, 51, 62, 0.75);
--modal-overlay-background-color: rgba(36, 51, 62, 0.8);
--progress-background-color: #24333e;
--progress-color: var(--primary);
--loading-spinner-opacity: 0.5;
--tooltip-background-color: var(--contrast);
--tooltip-color: var(--contrast-inverse);
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-chevron-button-inverse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
--icon-date: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
--icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
--icon-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
--icon-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
--icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
color-scheme: dark;
}
progress,
[type=checkbox],
[type=radio],
[type=range] {
accent-color: var(--primary);
}
/*# sourceMappingURL=default.css.map */

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 68 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,8 +1,9 @@
.jnotify-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
right: 0;
width: min(100%, 640px);
max-height: min(0.9vh, 480px) ;
z-index: 100000;
}
@@ -34,7 +35,7 @@
padding: 0 5px;
font: bold 1.4em Arial,Helvetica,sans-serif;
line-height: 1em;
color: #567b1b;
color: #497900;
text-decoration: none;
z-index: 3;
cursor: pointer;
@@ -45,8 +46,8 @@
z-index: 2;
padding: 20px;
text-align: center;
color: #567b1b;
font: bold 1.4em Arial,Helvetica,sans-serif;
color: #649a00;
font: bold 1em Arial,Helvetica,sans-serif;
line-height: 1.2em;
}
@@ -56,12 +57,13 @@
/* notification type == "error" */
.jnotify-container .jnotify-notification-error .jnotify-background {
background-color: #d79eac;
background-color: rgba(192, 0, 0, 0.8);
backdrop-filter: blur(5px);
}
.jnotify-container .jnotify-notification-error .jnotify-close,
.jnotify-container .jnotify-notification-error .jnotify-message {
color: #a72947 !important;
color: #ffffff !important;
}
/* notification type == "warning" */

View File

@@ -26,6 +26,7 @@ function getNav($Tmenu)
/**
* Get nav item
*
* TODO : Dropdown is actually not css implemented
* @param array $item Item of menu
* @param int $deep Level of deep
* @return string
@@ -47,6 +48,11 @@ function getNavItem($item, $deep = 0)
$item['active'] = true;
}
if(!isset($item['class'])){
$item['class'] = '--item-' . preg_replace( '/[^a-z0-9 ]/i','-', $item['id']);
}
if (!empty($item['overrride'])) {
$menu .= $item['overrride'];
} elseif (!empty($item['children'])) {
@@ -70,7 +76,7 @@ function getNavItem($item, $deep = 0)
$menuChildren .= getNavItem($child, $deep + 1);
$menuChildren .= "\n\r" . '<!-- print sub menu -->' . "\n\r";
} else {
$menuChildren .= '<li class="dropdown-item" data-deep="' . $deep . '" ><a href="' . $child['url'] . '" class="' . (!empty($child['active']) ? 'active' : '') . '" ">' . $child['name'] . '</a></li>';
$menuChildren .= '<li class="dropdown-item '.$item['class'].'" data-deep="' . $deep . '" ><a href="' . $child['url'] . '" class="' . (!empty($child['active']) ? 'active' : '') . '" ">' . $child['name'] . '</a></li>';
}
}
@@ -79,12 +85,12 @@ function getNavItem($item, $deep = 0)
$active = 'active';
}
$menu .= '<li data-deep="' . $deep . '" class="dropdown ' . ($deep > 0 ? 'dropdown-item dropdown-submenu' : 'nav-item') . ' ' . $active . '">';
$menu .= '<li data-deep="' . $deep . '" class="'.$item['class'].' dropdown ' . ($deep > 0 ? 'dropdown-item dropdown-submenu' : 'nav-item') . ' ' . $active . '">';
$menu .= '<a href="#" class="' . ($deep > 0 ? '' : 'nav-link') . ' dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . $item['name'] . ' <span class="caret"></span></a>';
$menu .= '<ul class="dropdown-menu ">' . $menuChildren . '</ul>';
$menu .= '</li>';
} else {
$menu .= '<li data-deep="' . $deep . '" class="' . ($deep > 0 ? 'dropdown-item' : 'nav-item ') . ' ' . ($item['active'] ? 'active' : '') . '"><a href="' . $item['url'] . '" class="' . ($deep > 0 ? '' : 'nav-link') . '" >' . $item['name'] . '</a></li>';
$menu .= '<li data-deep="' . $deep . '" class="'.$item['class'].' ' . ($deep > 0 ? 'dropdown-item' : 'nav-item ') . ' ' . ($item['active'] ? 'active' : '') . '"><a href="' . $item['url'] . '" class="' . ($deep > 0 ? '' : 'nav-link') . '" >' . $item['name'] . '</a></li>';
}
return $menu;

View File

@@ -94,7 +94,9 @@ if ($jsOut) {
$js .= '</script>';
print $js;
}
print '<script src="'.$context->getControllerUrl().'/js/theme.js"></script>';
?>
<script src="../js/theme.js"></script>
</body>
</html>

View File

@@ -39,4 +39,7 @@ global $langs;
print '<script src="' . $context->rootUrl . 'includes/jquery/plugins/jnotify/jquery.jnotify.js"></script>';
?>
</head>
<body>
<body
data-theme="custom"
data-controller="<?php print dol_escape_htmltag($context->controller); ?>"
>

View File

@@ -27,16 +27,7 @@ global $langs;
<?php
// JNotify
print '<link rel="stylesheet" href="' . $context->rootUrl . 'includes/jquery/plugins/jnotify/jquery.jnotify.css">';
?>
<style>
.login-page {
/* comment this var to remove image and see adaptative linear background */
/*--login-background : rgba(0,0,0,0.4) url("https://images.unsplash.com/photo-1552526408-fa252623b415?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0MDEyNzJ8MHwxfHNlYXJjaHwxNnx8cHVycGxlJTIwZmxvd2VyfGVufDB8MHx8fDE2ODc5NDY5NjB8MA&ixlib=rb-4.0.3&q=80&w=1080&w=1920");*/
--login-background: rgba(0, 0, 0, 0.4) url("https://images.unsplash.com/photo-1609607224685-44a36db58b10?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1080&w=1920");
--login-logo: url("../tpl/dolibarr_logo.svg"); /* for relative path, must be relative od the css file or use full url starting by http:// */
}
</style>
<?php
// JQuery
print '<script src="' . $context->rootUrl . 'includes/jquery/js/jquery.js"></script>';
// JNotify

View File

@@ -0,0 +1,6 @@
<section class="hero-header" <?php print !empty($context->theme->bannerUseDarkTheme) ? ' data-theme="dark" ': '' ?> >
<div class="container">
<h1 class="hero-header__title"><?php print $context->title; ?></h1>
<div class="hero-header__desc"><?php print $context->desc; ?></div>
</div>
</section>

View File

@@ -6,31 +6,29 @@ if (empty($context) || !is_object($context)) {
}
global $conf, $langs;
?>
<main class="container">
<figure>
<div class="grid">
<div class="home-links-grid grid">
<?php
if (isModEnabled('propal') && getDolGlobalInt('WEBPORTAL_PROPAL_LIST_ACCESS')) {
?>
<div><?php print '<a href="' . $context->getControllerUrl('propallist') . '" title="' . $langs->trans('WebPortalPropalListDesc') . '">' . $langs->trans('WebPortalPropalListTitle') . '</a>'; ?></div>
<?php
}
?>
<?php
if (isModEnabled('commande') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS')) {
?>
<div><?php print '<a href="' . $context->getControllerUrl('orderlist') . '" title="' . $langs->trans('WebPortalOrderListDesc') . '">' . $langs->trans('WebPortalOrderListTitle') . '</a>'; ?></div>
<?php
}
?>
<?php
if (isModEnabled('facture') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS')) {
?>
<div><?php print '<a href="' . $context->getControllerUrl('invoicelist') . '" title="' . $langs->trans('WebPortalInvoiceListDesc') . '">' . $langs->trans('WebPortalInvoiceListTitle') . '</a>'; ?></div>
<?php
}
?>
if (isModEnabled('propal') && getDolGlobalInt('WEBPORTAL_PROPAL_LIST_ACCESS')) : ?>
<article class="home-links-card --propal-list">
<div class="home-links-card__icon" ></div>
<?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('propallist') . '" title="' . $langs->trans('WebPortalPropalListDesc') . '">' . $langs->trans('WebPortalPropalListTitle') . '</a>'; ?>
</article>
<?php endif; ?>
<?php if (isModEnabled('commande') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS')) : ?>
<article class="home-links-card --order-list">
<div class="home-links-card__icon" ></div>
<?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('orderlist') . '" title="' . $langs->trans('WebPortalOrderListDesc') . '">' . $langs->trans('WebPortalOrderListTitle') . '</a>'; ?>
</article>
<?php endif; ?>
<?php if (isModEnabled('facture') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS')) : ?>
<article class="home-links-card --invoice-list">
<div class="home-links-card__icon" ></div>
<?php print '<a class="home-links-card__link" href="' . $context->getControllerUrl('invoicelist') . '" title="' . $langs->trans('WebPortalInvoiceListDesc') . '">' . $langs->trans('WebPortalInvoiceListTitle') . '</a>'; ?>
</article>
<?php endif; ?>
</div>
</figure>
</main>

View File

@@ -4,6 +4,10 @@ if (empty($context) || !is_object($context)) {
print "Error, template page can't be called as URL";
exit;
}
?>
<div class="login-page__container">
<div class="login-screen">
@@ -11,29 +15,29 @@ if (empty($context) || !is_object($context)) {
<form class="login">
<input type="hidden" name="action_login" value="login">
<div class="login__logo"></div>
<div class="login__logo"><!-- see --login-logo css var to change logo --></div>
<div class="login__field">
<i class="login__icon fas fa-user"></i>
<input type="text" class="login__input" name="login" placeholder="User name / Email">
<input type="text" class="login__input" name="login" placeholder="<?php print dol_escape_htmltag($langs->trans('loginWebportalUserName')); ?>">
</div>
<div class="login__field">
<i class="login__icon fas fa-lock"></i>
<input type="password" class="login__input" name="password" placeholder="Password">
<input type="password" class="login__input" name="password" placeholder="<?php print dol_escape_htmltag($langs->trans('loginWebportalPassword')) ?>">
</div>
<button class="button login__submit">
<span class="button__text">Log In Now</span>
<span class="button__text"><?php print dol_escape_htmltag($langs->trans('LoginNow')) ?></span>
<i class="button__icon fas fa-chevron-right"></i>
</button>
</form>
<div class="social-login">
<span class="social-login__title">log in via</span>
<div class="social-icons">
<a href="#" class="social-login__icon fab fa-instagram"></a>
<a href="#" class="social-login__icon fab fa-facebook"></a>
<a href="#" class="social-login__icon fab fa-twitter"></a>
</div>
</div>
<!-- <div class="social-login">-->
<!-- <span class="social-login__title">Follow us on</span>-->
<!-- <div class="social-icons">-->
<!-- <a href="#" class="social-login__icon fab fa-instagram"></a>-->
<!-- <a href="#" class="social-login__icon fab fa-facebook"></a>-->
<!-- <a href="#" class="social-login__icon fab fa-twitter"></a>-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="login-screen__background">
<span class="login-screen__background__shape login-screen__background__shape4"></span>

View File

@@ -7,14 +7,14 @@ if (empty($context) || !is_object($context)) {
global $conf, $hookmanager, $langs;
$Tmenu = $TGroupMenu = array();
$navMenu = $navGroupMenu = $navUserMenu = array();
$maxTopMenu = 0;
if ($context->userIsLog()) {
// menu propal
if (isModEnabled('propal') && getDolGlobalInt('WEBPORTAL_PROPAL_LIST_ACCESS')) {
$Tmenu['propal_list'] = array(
$navMenu['propal_list'] = array(
'id' => 'propal_list',
'rank' => 10,
'url' => $context->getControllerUrl('propallist'),
@@ -25,7 +25,7 @@ if ($context->userIsLog()) {
// menu orders
if (isModEnabled('commande') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS')) {
$Tmenu['order_list'] = array(
$navMenu['order_list'] = array(
'id' => 'order_list',
'rank' => 20,
'url' => $context->getControllerUrl('orderlist'),
@@ -36,7 +36,7 @@ if ($context->userIsLog()) {
// menu invoices
if (isModEnabled('facture') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS')) {
$Tmenu['invoice_list'] = array(
$navMenu['invoice_list'] = array(
'id' => 'invoice_list',
'rank' => 30,
'url' => $context->getControllerUrl('invoicelist'),
@@ -52,7 +52,7 @@ if ($context->userIsLog()) {
&& $context->logged_member
&& $context->logged_member->id > 0
) {
$Tmenu['member_card'] = array(
$navMenu['member_card'] = array(
'id' => 'member_card',
'rank' => 110,
'url' => $context->getControllerUrl('membercard'),
@@ -68,7 +68,7 @@ if ($context->userIsLog()) {
&& $context->logged_partnership
&& $context->logged_partnership->id > 0
) {
$Tmenu['partnership_card'] = array(
$navMenu['partnership_card'] = array(
'id' => 'partnership_card',
'rank' => 120,
'url' => $context->getControllerUrl('partnershipcard'),
@@ -78,16 +78,16 @@ if ($context->userIsLog()) {
}
// menu user with logout
$Tmenu['user_logout'] = array(
$navUserMenu['user_logout'] = array(
'id' => 'user_logout',
'rank' => 200,
'rank' => 99999,
'url' => $context->getControllerUrl() . 'logout.php',
'name' => $langs->trans('Logout'),
);
}
// GROUP MENU
$TGroupMenu = array(
$navGroupMenu = array(
'administrative' => array(
'id' => 'administrative',
'rank' => -1, // negative value for undefined, it will be set by the min item rank for this group
@@ -106,8 +106,8 @@ $TGroupMenu = array(
$parameters = array(
'controller' => $context->controller,
'Tmenu' => & $Tmenu,
'TGroupMenu' => & $TGroupMenu,
'Tmenu' => & $navMenu,
'TGroupMenu' => & $navGroupMenu,
'maxTopMenu' => & $maxTopMenu
);
@@ -116,73 +116,83 @@ if ($reshook < 0) $context->setEventMessages($hookmanager->error, $hookmanager->
if (empty($reshook)) {
if (!empty($hookmanager->resArray)) {
$Tmenu = array_replace($Tmenu, $hookmanager->resArray);
$navMenu = array_replace($navMenu, $hookmanager->resArray);
}
if (!empty($Tmenu)) {
if (!empty($navMenu)) {
// Sorting
uasort($Tmenu, 'menuSortInv');
uasort($navMenu, 'menuSortInv');
if (!empty($maxTopMenu) && $maxTopMenu < count($Tmenu)) {
if (!empty($maxTopMenu) && $maxTopMenu < count($navMenu)) {
// AFFECT MENU ITEMS TO GROUPS
foreach ($Tmenu as $menuId => $menuItem) {
foreach ($navMenu as $menuId => $menuItem) {
// affectation des items de menu au groupement
if (!empty($menuItem['group']) && !empty($TGroupMenu[$menuItem['group']])) {
if (!empty($menuItem['group']) && !empty($navGroupMenu[$menuItem['group']])) {
$goupId = $menuItem['group'];
// Affectation de l'item au groupe
$TGroupMenu[$goupId]['children'][$menuId] = $menuItem;
$navGroupMenu[$goupId]['children'][$menuId] = $menuItem;
// Application du rang
if (!empty($TGroupMenu[$goupId]['rank']) && $TGroupMenu[$goupId]['rank'] > 0) {
if (!empty($navGroupMenu[$goupId]['rank']) && $navGroupMenu[$goupId]['rank'] > 0) {
// le rang mini des items du groupe défini le rang du groupe
$TGroupMenu[$goupId]['rank'] = min(abs($TGroupMenu[$goupId]['rank']), abs($menuItem['rank']));
$navGroupMenu[$goupId]['rank'] = min(abs($navGroupMenu[$goupId]['rank']), abs($menuItem['rank']));
}
}
}
// INSERTION DES GROUPES DANS LE MENU
foreach ($TGroupMenu as $groupId => $groupItem) {
foreach ($navGroupMenu as $groupId => $groupItem) {
// If group have more than 1 item, group is valid
if (!empty($groupItem['children']) && count($groupItem['children']) > 1) {
// ajout du group au menu
$Tmenu[$groupId] = $groupItem;
$navMenu[$groupId] = $groupItem;
// suppression des items enfant du group du menu
foreach ($groupItem['children'] as $menuId => $menuItem) {
if (isset($Tmenu[$menuId])) {
unset($Tmenu[$menuId]);
if (isset($navMenu[$menuId])) {
unset($navMenu[$menuId]);
}
}
}
}
// final sorting
uasort($Tmenu, 'menuSortInv');
uasort($navMenu, 'menuSortInv');
}
}
}
?>
<nav class="container-fluid">
<nav class="primary-top-nav container-fluid">
<ul>
<li class="brand">
<img src="./tpl/dolibarr_logo.svg">
</li>
<li>
<strong>
<?php
if (!empty($context->title)) {
print $context->title;
$brandTitle = !empty($conf->global->WEBPORTAL_TITLE) ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >';
if(!empty($context->theme->menuLogoUrl)){
print '<img class="brand__logo-img" src="'.dol_escape_htmltag($context->theme->menuLogoUrl).'" alt="'.dol_escape_htmltag($brandTitle).'" >';
}else{
print '<span class="brand__name">'.$brandTitle.'</span>';
}
print '</a>';
?>
</strong>
</li>
</ul>
<ul>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($Tmenu)) {
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navMenu)) {
// show menu
print getNav($Tmenu);
print getNav($navMenu);
}
?>
</ul>
<ul>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navUserMenu)) {
// show menu
uasort($navUserMenu, 'menuSortInv');
print getNav($navUserMenu);
}
?>
</ul>

View File

@@ -1,17 +1,20 @@
<?php
define('WEBPORTAL', 1);
define('NOSESSION', 1);
define('NOLOGIN', 1);
define('NOREQUIREUSER', 1); // $user
define('NOREQUIREMENU', 1);
define('NOREQUIRESOC', 1); // $mysoc
define('EVEN_IF_ONLY_LOGIN_ALLOWED', 1);
if (!defined('WEBPORTAL')) { define('WEBPORTAL', 1); }
if (!defined('NOSESSION')) { define('NOSESSION', 1); }
if (!defined('NOLOGIN')) { define('NOLOGIN', 1); }
if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', 1); }
if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', 1); }
if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', 1); }
if (!defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) { define('EVEN_IF_ONLY_LOGIN_ALLOWED', 1); }
// Change this following line to use the correct relative path (../, ../../, etc)
$res = 0;
if (!$res && file_exists('../../main.inc.php')) $res = @include '../../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory
if (!$res && file_exists('../../../main.inc.php')) $res = @include '../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (!$res && file_exists('../../../../main.inc.php')) $res = @include '../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (!$res && file_exists('../../../../../main.inc.php')) $res = @include '../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (!$res && file_exists('../../../../../../main.inc.php')) $res = @include '../../../../../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
if (!$res) die('Include of main fails');
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societeaccount.class.php';
@@ -213,3 +216,5 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access
}
}
}