Erreur de rebase corrigée

This commit is contained in:
fredtempez 2021-11-25 13:40:14 +01:00
parent 4aa5938953
commit 6ff1444deb
2 changed files with 55 additions and 74 deletions

View File

@ -220,47 +220,29 @@ core.start = function() {
}); });
/** /**
* Message sur l'utilisation des cookies * Traitement du formulaire cookies
*/ */
var analytics = ""; $("#cookieForm").submit(function(event){
if (<?php echo json_encode($this->getData(['config', 'seo', 'analyticsId'])); ?>) { var samesite = "samesite=lax";
analytics = ' grâce au cookie Google Analytics' var getUrl = window.location;
} var domain = "domain=" + getUrl.host;
if(<?php echo json_encode($this->getData(['config', 'cookieConsent'])); ?>) { var path = "path=" + getUrl.pathname.split('/')[1];
if(document.cookie.indexOf("ZWII_COOKIE_CONSENT") === -1) { var samesite = "samesite=lax";
$("body").append( var e = new Date();
$("<div>").attr("id", "cookieConsent").append( e.setFullYear(e.getFullYear() + 1);
$("<span>").html("<p>Ce site utilise des cookies pour assurer l'authentification, améliorer l'expérience utilisateur"+analytics+". <br/>En cliquant sur ”Jaccepte”, vous acceptez lutilisation de ces cookies.</p>"), var expires = "expires=" + e.toUTCString();
$("<span>")
.attr("id", "cookieConsentConfirm") // Crée le cookie d'acceptation Google Analytics si nécessaire
.text("Accepter") var analytics = "<?php echo $this->getData(['config', 'seo', 'analyticsId']);?>";
.on("click", function() { if( analytics.length > 0){
// Créé le cookie d'acceptation document.cookie = "ZWII_COOKIE_GA_CONSENT=" + $("#googleAnalytics").prop("checked") + "<?php echo $_SERVER['PHP_SELF']; ?>" +";" + domain + ";" + path + ";" + samesite + ";" + expires;
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();
}),
$("<span>")
.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();
}),
)
);
} }
} document.cookie = "ZWII_COOKIE_CONSENT=<?php echo $_SERVER['PHP_SELF']; ?>;" + domain + ";" + path + ";" + samesite + ";" + expires;
});
$("#cookieConsent .cookieClose").on("click", function() {
$(this).parents("#cookieConsent").fadeOut();
});
/** /**
* Choix de page dans la barre de membre * Choix de page dans la barre de membre
*/ */

View File

@ -45,7 +45,7 @@ class common {
// Numéro de version // Numéro de version
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; 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"; const ZWII_UPDATE_CHANNEL = "test";
public static $actions = []; public static $actions = [];
@ -1188,36 +1188,36 @@ class common {
/** /**
* Affiche le consentement aux cookies * Affiche le consentement aux cookies
*/ */
public function showCookies() { public function showCookies() {
if( $this->getInput('ZWII_COOKIE_CONSENT') !== $_SERVER['PHP_SELF'] AND if( $this->getInput('ZWII_COOKIE_CONSENT') !== $_SERVER['PHP_SELF'] AND
$this->getData(['config', 'cookies', 'cookieConsent']) === true $this->getData(['config', 'cookies', 'cookieConsent']) === true
){ ){
$analytics = $this->getData(['config', 'seo', 'analyticsId']); $analytics = $this->getData(['config', 'seo', 'analyticsId']);
$legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']);
$item = '<div id="cookieConsent">'; $item = '<div id="cookieConsent">';
$item .= '<div class="cookieClose">'; $item .= '<div class="cookieClose">';
$item .= template::ico('cancel'); $item .= template::ico('cancel');
$item .= '</div>'; $item .= '</div>';
$item .= '<h3>'. $this->getData(['config', 'cookies', 'cookiesTitleText']) . '</h3>'; $item .= '<h3>'. $this->getData(['config', 'cookies', 'cookiesTitleText']) . '</h3>';
$item .= '<p>' . $this->getData(['config', 'cookies', 'cookiesZwiiText']) . '</p>'; $item .= '<p>' . $this->getData(['config', 'cookies', 'cookiesZwiiText']) . '</p>';
$item .= '<p><a href="' . helper::baseUrl() . $legalPage . '">' . $this->getData(['config', 'cookies', 'cookiesLinkMlText']) . '</a></p>'; $item .= '<p><a href="' . helper::baseUrl() . $legalPage . '">' . $this->getData(['config', 'cookies', 'cookiesLinkMlText']) . '</a></p>';
if( $analytics !== null AND $analytics !=='' ){ if( $analytics !== null AND $analytics !=='' ){
$item .= '<p>' . $this->getData(['config', 'cookies', 'cookiesGaText']) . '</p>'; $item .= '<p>' . $this->getData(['config', 'cookies', 'cookiesGaText']) . '</p>';
} }
$item .= '<form method="POST" action="" id="cookieForm">'; $item .= '<form method="POST" action="" id="cookieForm">';
if( $analytics !== null AND $analytics !=='' ) { if( $analytics !== null AND $analytics !=='' ) {
$item .= '<input type="checkbox" id="googleAnalytics" name="googleAnalytics" value="GA">'; $item .= '<input type="checkbox" id="googleAnalytics" name="googleAnalytics" value="GA">';
$item .= '<label for="googleAnalytics">' . $this->getData(['config', 'cookies', 'cookiesCheckboxGaText']) . '</label>'; $item .= '<label for="googleAnalytics">' . $this->getData(['config', 'cookies', 'cookiesCheckboxGaText']) . '</label>';
} }
$item .= '<br><br>'; $item .= '<br><br>';
$item .= '<input type="submit" id="cookieConsentConfirm" value="Valider">'; $item .= '<input type="submit" id="cookieConsentConfirm" value="Valider">';
$item .= '</form></div>'; $item .= '</form></div>';
echo $item; echo $item;
} }
} }
/** /**
* Formate le contenu de la page selon les gabarits * Formate le contenu de la page selon les gabarits
@ -2276,16 +2276,15 @@ class core extends common {
$css .= 'header{margin:20px 20px 0 20px}'; $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' ) { 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 // 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'])) { 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']) . '}'; $css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
} }