From 6ff1444debfc4184b7d35f3af50f4a1e367d4a9e Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 25 Nov 2021 13:40:14 +0100 Subject: [PATCH] =?UTF-8?q?Erreur=20de=20rebase=20corrig=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.js.php | 60 +++++++++++++++-------------------------- core/core.php | 69 ++++++++++++++++++++++++------------------------ 2 files changed, 55 insertions(+), 74 deletions(-) diff --git a/core/core.js.php b/core/core.js.php index f15929df..170ae25a 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -220,47 +220,29 @@ core.start = function() { }); /** - * Message sur l'utilisation des cookies + * Traitement du formulaire cookies */ - var analytics = ""; - if (getData(['config', 'seo', 'analyticsId'])); ?>) { - analytics = ' grâce au cookie Google Analytics' - } - if(getData(['config', 'cookieConsent'])); ?>) { - if(document.cookie.indexOf("ZWII_COOKIE_CONSENT") === -1) { - $("body").append( - $("
").attr("id", "cookieConsent").append( - $("").html("

Ce site utilise des cookies pour assurer l'authentification, améliorer l'expérience utilisateur"+analytics+".
En cliquant sur ”J’accepte”, vous acceptez l’utilisation de ces cookies.

"), - $("") - .attr("id", "cookieConsentConfirm") - .text("Accepter") - .on("click", function() { - // Créé le cookie d'acceptation - var expires = new Date(); - expires.setFullYear(expires.getFullYear() + 1); - expires = "expires=" + expires.toUTCString(); - var getUrl = window.location; - document.cookie = "ZWII_COOKIE_CONSENT=true;domain=" + getUrl.host + ";path=" + getUrl.pathname.split('/')[1] + ";samesite=strict;" + expires; - // Ferme le message - $(this).parents("#cookieConsent").fadeOut(); - }), - $("") - .attr("id", "cookieConsentRefuse") - .text("Refuser") - .on("click", function() { - // Créé le cookie d'acceptation - var expires = new Date(); - expires.setFullYear(expires.getFullYear() + 1); - expires = "expires=" + expires.toUTCString(); - var getUrl = window.location; - document.cookie = "ZWII_COOKIE_CONSENT=true;domain=" + getUrl.host + ";path=" + getUrl.pathname.split('/')[1] + ";samesite=strict;" + expires; - // Ferme le message - $(this).parents("#cookieConsent").fadeOut(); - }), - ) - ); + $("#cookieForm").submit(function(event){ + var samesite = "samesite=lax"; + var getUrl = window.location; + var domain = "domain=" + getUrl.host; + var path = "path=" + getUrl.pathname.split('/')[1]; + var samesite = "samesite=lax"; + var e = new Date(); + e.setFullYear(e.getFullYear() + 1); + var expires = "expires=" + e.toUTCString(); + + // Crée le cookie d'acceptation Google Analytics si nécessaire + var analytics = "getData(['config', 'seo', 'analyticsId']);?>"; + if( analytics.length > 0){ + document.cookie = "ZWII_COOKIE_GA_CONSENT=" + $("#googleAnalytics").prop("checked") + "" +";" + domain + ";" + path + ";" + samesite + ";" + expires; } - } + document.cookie = "ZWII_COOKIE_CONSENT=;" + domain + ";" + path + ";" + samesite + ";" + expires; + }); + + $("#cookieConsent .cookieClose").on("click", function() { + $(this).parents("#cookieConsent").fadeOut(); + }); /** * Choix de page dans la barre de membre */ diff --git a/core/core.php b/core/core.php index a4a979d5..4f562b7d 100644 --- a/core/core.php +++ b/core/core.php @@ -45,7 +45,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; - const ZWII_VERSION = '11.2.00.8'; + const ZWII_VERSION = '11.2.00.9'; const ZWII_UPDATE_CHANNEL = "test"; public static $actions = []; @@ -1188,36 +1188,36 @@ class common { /** * Affiche le consentement aux cookies */ - public function showCookies() { + public function showCookies() { - if( $this->getInput('ZWII_COOKIE_CONSENT') !== $_SERVER['PHP_SELF'] AND - $this->getData(['config', 'cookies', 'cookieConsent']) === true - ){ + if( $this->getInput('ZWII_COOKIE_CONSENT') !== $_SERVER['PHP_SELF'] AND + $this->getData(['config', 'cookies', 'cookieConsent']) === true + ){ - $analytics = $this->getData(['config', 'seo', 'analyticsId']); - $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); - $item = '
'; - $item .= '
'; - $item .= template::ico('cancel'); - $item .= '
'; - $item .= '

'. $this->getData(['config', 'cookies', 'cookiesTitleText']) . '

'; - $item .= '

' . $this->getData(['config', 'cookies', 'cookiesZwiiText']) . '

'; - $item .= '

' . $this->getData(['config', 'cookies', 'cookiesLinkMlText']) . '

'; - if( $analytics !== null AND $analytics !=='' ){ - $item .= '

' . $this->getData(['config', 'cookies', 'cookiesGaText']) . '

'; - } - $item .= '
'; - if( $analytics !== null AND $analytics !=='' ) { - $item .= ''; - $item .= ''; - } - $item .= '

'; - $item .= ''; - $item .= '
'; - echo $item; - } + $analytics = $this->getData(['config', 'seo', 'analyticsId']); + $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); + $item = '
'; + $item .= '
'; + $item .= template::ico('cancel'); + $item .= '
'; + $item .= '

'. $this->getData(['config', 'cookies', 'cookiesTitleText']) . '

'; + $item .= '

' . $this->getData(['config', 'cookies', 'cookiesZwiiText']) . '

'; + $item .= '

' . $this->getData(['config', 'cookies', 'cookiesLinkMlText']) . '

'; + if( $analytics !== null AND $analytics !=='' ){ + $item .= '

' . $this->getData(['config', 'cookies', 'cookiesGaText']) . '

'; + } + $item .= '
'; + if( $analytics !== null AND $analytics !=='' ) { + $item .= ''; + $item .= ''; + } + $item .= '

'; + $item .= ''; + $item .= '
'; + echo $item; + } - } + } /** * Formate le contenu de la page selon les gabarits @@ -2276,16 +2276,15 @@ class core extends common { $css .= 'header{margin:20px 20px 0 20px}'; } } - // Couleur du fonc - $colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor'])); - $css .= 'header{background-color:' . $colors['normal'].'}'; - if ($this->getData(['theme','header','feature']) === 'wallpaper' ) { + $colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor'])); + $css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}'; + $css .= 'header{background-color:' . $colors['normal']; - $css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).';}'; - // Valeur de hauteur traditionnelle - $css .= 'header{height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; + $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ; + + $css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) { $css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}'; }