diff --git a/core/layout/mail.php b/core/layout/mail.php index 5c588a95..10ed6083 100755 --- a/core/layout/mail.php +++ b/core/layout/mail.php @@ -109,7 +109,18 @@
- getData(['locale', 'title']); ?> + + getData(['module', $this->getUrl(0), 'config', 'signature' ]) === 'logo' && is_file( 'site/file/source/'. $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl' ]))){ + $imageFile = helper::baseUrl(false).'site/file/source/'. $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl' ]) ; + $imageBase64 = base64_encode(file_get_contents($imageFile)); + ?> + getData(['locale', 'title']); + } ?> +
@@ -124,4 +135,4 @@ - \ No newline at end of file + diff --git a/module/form/form.php b/module/form/form.php index c6a360be..373b6b40 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -63,6 +63,17 @@ class form extends common { public static $listUsers = [ ]; + public static $signature = [ + 'text' => 'Nom du site', + 'logo' => 'Logo du site' + ]; + + public static $logoWidth = [ + '40' => '40%', + '60' => '60%', + '80' => '80%', + '100' => '100%' + ]; /** * Configuration @@ -90,7 +101,10 @@ class form extends common { 'mail' => $this->getInput('formConfigMail') , 'pageId' => $this->getInput('formConfigPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formConfigPageId', helper::FILTER_ID) : '', 'subject' => $this->getInput('formConfigSubject'), - 'replyto' => $this->getInput('formConfigMailReplyTo', helper::FILTER_BOOLEAN) + 'replyto' => $this->getInput('formConfigMailReplyTo', helper::FILTER_BOOLEAN), + 'signature' => $this->getInput('formConfigSignature'), + 'logoUrl' => $this->getInput('formConfigLogo'), + 'logoWidth' => $this->getInput('formConfigLogoWidth') ] ]); // Génération des données vides diff --git a/module/form/view/config/config.js.php b/module/form/view/config/config.js.php index 4d0788d2..ba0d3d13 100755 --- a/module/form/view/config/config.js.php +++ b/module/form/view/config/config.js.php @@ -133,13 +133,13 @@ $("#formConfigInputs") case "label": _this.parents(".formConfigInput").find("label[for*=formConfigRequired]").hide(); _this.parents(".formConfigInput").find(".formConfigLabelWrapper").slideDown(); - _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideUp(); + _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideUp(); break; default: _this.parents(".formConfigInput").find("label[for*=formConfigRequired]").show(); - _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideUp(); - _this.parents(".formConfigInput").find(".formConfigLabelWrapper").slideUp(); - } + _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideUp(); + _this.parents(".formConfigInput").find(".formConfigLabelWrapper").slideUp(); + } }); // Simule un changement de type au chargement de la page $(".formConfigType").trigger("change"); @@ -173,4 +173,43 @@ $("#formConfigPageIdToggle").on("change", function() { $("#formConfigPageId").val(""); }); } -}).trigger("change"); \ No newline at end of file +}).trigger("change"); + +/** +* Paramètres par défaut au chargement +*/ +$( document ).ready(function() { + + /** + * Masquer ou afficher la sélection du logo + */ + if ($("#formConfigSignature").val() !== "text") { + $("#formConfigLogoWrapper").addClass("disabled"); + $("#formConfigLogoWrapper").slideDown(); + $("#formConfigLogoWidthWrapper").addClass("disabled"); + $("#formConfigLogoWidthWrapper").slideDown(); + } else { + $("#formConfigLogoWrapper").removeClass("disabled"); + $("#formConfigLogoWrapper").slideUp(); + $("#formConfigLogoWidthWrapper").removeClass("disabled"); + $("#formConfigLogoWidthWrapper").slideUp(); + } +}); + +/** + * Masquer ou afficher la sélection du logo + */ +var formConfigSignatureDOM = $("#formConfigSignature"); +formConfigSignatureDOM.on("change", function() { + if ($(this).val() !== "text") { + $("#formConfigLogoWrapper").addClass("disabled"); + $("#formConfigLogoWrapper").slideDown(); + $("#formConfigLogoWidthWrapper").addClass("disabled"); + $("#formConfigLogoWidthWrapper").slideDown(); + } else { + $("#formConfigLogoWrapper").removeClass("disabled"); + $("#formConfigLogoWrapper").slideUp(); + $("#formConfigLogoWidthWrapper").removeClass("disabled"); + $("#formConfigLogoWidthWrapper").slideUp(); + } +}); diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index fea6d9ff..6631a20a 100755 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -128,6 +128,27 @@ +
+
+ 'Sélectionner le type de signature', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature']) + ]); ?> +
+
+ 'Sélectionnez le logo du site', + 'label' => 'Logo', + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl']) + ]); ?> +
+
+ 'Sélectionner la largeur du logo', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth']) + ]); ?> +
+