diff --git a/core/core.php b/core/core.php index a3b4dc2a..0f36f28d 100755 --- a/core/core.php +++ b/core/core.php @@ -36,7 +36,7 @@ class common { const THUMBS_WIDTH = 640; // Numéro de version - const ZWII_VERSION = '10.0.089'; + const ZWII_VERSION = '10.0.090'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1316,9 +1316,10 @@ class core extends common { $css .= 'body,.block h4{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; $css .= 'select,input[type=\'email\'],input[type=\'text\'],textarea{color:' . $this->getData(['theme', 'text', 'backgroundColor']) . '}'; // Couleur fixée dans admin.css - //$css .= '.button.buttonGrey,.button.buttonGrey:hover{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; + //$css .= '.button.buttonGrey,.button.buttonGrey:hover{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; $css .= '.container{max-width:' . $this->getData(['theme', 'site', 'width']) . '}'; - $css .= $this->getData(['theme', 'site', 'width']) === '100%' ? '#site{margin:0 auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}': ''; + $margin = $this->getData(['theme', 'site', 'margin']) ? '0' : '20px'; + $css .= $this->getData(['theme', 'site', 'width']) === '100%' ? '#site{margin:0 auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}': "#site{margin: " . $margin . " auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} "; $css .= $this->getData(['theme', 'site', 'width']) === '750px' ? '.button, button{font-size:0.8em;}' : ''; $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}'; $css .= '.editorWysiwyg {background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}'; diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 57863878..af100b99 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -519,7 +519,8 @@ class theme extends common { 'backgroundColor' => $this->getInput('themeSiteBackgroundColor'), 'radius' => $this->getInput('themeSiteRadius'), 'shadow' => $this->getInput('themeSiteShadow'), - 'width' => $this->getInput('themeSiteWidth') + 'width' => $this->getInput('themeSiteWidth'), + 'margin' => $this->getInput('themeSiteMargin',helper::FILTER_BOOLEAN) ]]); // Valeurs en sortie $this->addOutput([ diff --git a/core/module/theme/view/site/site.js.php b/core/module/theme/view/site/site.js.php index a7768c70..04945db6 100755 --- a/core/module/theme/view/site/site.js.php +++ b/core/module/theme/view/site/site.js.php @@ -21,6 +21,15 @@ $( document).ready(function() { * Aperçu en direct */ $("input, select").on("change",function() { + /** + * Option de marge si la taille n'est pas fluide + */ + if ($('#themeSiteWidth').val() === '100%') { + $("#themeSiteMargin").prop("checked", true); + $("#themeSiteMargin").addClass("disabled"); + } else { + $("#themeSiteMargin").addClass("enabled"); + } updateDOM(); }); @@ -68,12 +77,12 @@ function updateDOM() { css += ".button, button{font-size:1em;}"; } // Largeur du site + var margin = $("#themeSiteMargin").is(":checked") ? 0 : '20px' ; css += ".container{max-width:" + $("#themeSiteWidth").val() + "}"; if ($("#themeSiteWidth").val() === "100%") { - css += "#site{margin:0 auto;} body{margin:0 auto;} #bar{margin:0 auto;} body > header{margin:0 auto;} body > nav {margin: 0 auto;} body > footer {margin:0 auto;}"; + css += "#site{margin: 0px auto;} body{margin:0 auto;} #bar{margin:0 auto;} body > header{margin:0 auto;} body > nav {margin: 0 auto;} body > footer {margin:0 auto;}"; } else { - css += "#site{margin:20px auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} "; - + css += "#site{margin: " + margin + " auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} "; } // Couleur du site, arrondi sur les coins du site et ombre sur les bords du site //css += "#site{background-color:" + $("#themeSiteBackgroundColor").val() + ";border-radius:" + $("#themeSiteRadius").val() + ";box-shadow:" + $("#themeSiteShadow").val() + " #212223}"; diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index b8a0686a..c2b6b222 100755 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -162,6 +162,13 @@ ]); ?> +