diff --git a/module/form/form.php b/module/form/form.php index af1b181f..e677542b 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -24,7 +24,7 @@ class form extends common { public static $actions = [ 'config' => self::GROUP_MODERATOR, - 'layout' => self::GROUP_MODERATOR, + 'option' => self::GROUP_MODERATOR, 'data' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR, 'deleteall' => self::GROUP_MODERATOR, @@ -146,7 +146,7 @@ class form extends common { } - public function layout() { + public function option() { // Liste des utilisateurs $userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname'); ksort($userIdsFirstnames); @@ -162,17 +162,17 @@ class form extends common { $this->getUrl(0), 'config', [ - 'button' => $this->getInput('formLayoutButton'), - 'captcha' => $this->getInput('formLayoutCaptcha', helper::FILTER_BOOLEAN), - 'group' => $this->getInput('formLayoutGroup', helper::FILTER_INT), - 'user' => self::$listUsers [$this->getInput('formLayoutUser', helper::FILTER_INT)], - 'mail' => $this->getInput('formLayoutMail') , - 'pageId' => $this->getInput('formLayoutPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formLayoutPageId', helper::FILTER_ID) : '', - 'subject' => $this->getInput('formLayoutSubject'), - 'replyto' => $this->getInput('formLayoutMailReplyTo', helper::FILTER_BOOLEAN), - 'signature' => $this->getInput('formLayoutSignature'), - 'logoUrl' => $this->getInput('formLayoutLogo'), - 'logoWidth' => $this->getInput('formLayoutLogoWidth') + 'button' => $this->getInput('formOptionButton'), + 'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN), + 'group' => $this->getInput('formOptionGroup', helper::FILTER_INT), + 'user' => self::$listUsers [$this->getInput('formOptionUser', helper::FILTER_INT)], + 'mail' => $this->getInput('formOptionMail') , + 'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '', + 'subject' => $this->getInput('formOptionSubject'), + 'replyto' => $this->getInput('formOptionMailReplyTo', helper::FILTER_BOOLEAN), + 'signature' => $this->getInput('formOptionSignature'), + 'logoUrl' => $this->getInput('formOptionLogo'), + 'logoWidth' => $this->getInput('formOptionLogoWidth') ] ]); // Génération des données vides @@ -200,7 +200,7 @@ class form extends common { 'html-sortable', 'flatpickr' ], - 'view' => 'layout' + 'view' => 'option' ]); } } diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 60cf1b6c..e992f834 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -66,8 +66,8 @@
helper::baseUrl() . $this->getUrl(0) . '/layout', - 'value' => 'Paramètres', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/option', + 'value' => 'Options', 'ico' => 'cog-alt' ]); ?>
diff --git a/module/form/view/layout/layout.js.php b/module/form/view/layout/layout.js.php deleted file mode 100644 index 8970a0fe..00000000 --- a/module/form/view/layout/layout.js.php +++ /dev/null @@ -1,72 +0,0 @@ - - - -/* -* Affiche/cache les options de la case à cocher du mail -*/ -$("#formLayoutMailOptionsToggle").on("change", function() { - if($(this).is(":checked")) { - $("#formLayoutMailOptions").slideDown(); - } - else { - $("#formLayoutMailOptions").slideUp(function() { - $("#formLayoutGroup").val(""); - $("#formLayoutSubject").val(""); - $("#formLayoutMail").val(""); - $("#formLayoutUser").val(""); - }); - } -}).trigger("change"); - -/** -* Affiche/cache les options de la case à cocher de la redirection -*/ -$("#formLayoutPageIdToggle").on("change", function() { - if($(this).is(":checked")) { - $("#formLayoutPageIdWrapper").slideDown(); - } - else { - $("#formLayoutPageIdWrapper").slideUp(function() { - $("#formLayoutPageId").val(""); - }); - } -}).trigger("change"); - -/** -* Paramètres par défaut au chargement -*/ -$( document ).ready(function() { - - /** - * Masquer ou afficher la sélection du logo - */ - if ($("#formLayoutSignature").val() !== "text") { - $("#formLayoutLogoWrapper").addClass("disabled"); - $("#formLayoutLogoWrapper").slideDown(); - $("#formLayoutLogoWidthWrapper").addClass("disabled"); - $("#formLayoutLogoWidthWrapper").slideDown(); - } else { - $("#formLayoutLogoWrapper").removeClass("disabled"); - $("#formLayoutLogoWrapper").slideUp(); - $("#formLayoutLogoWidthWrapper").removeClass("disabled"); - $("#formLayoutLogoWidthWrapper").slideUp(); - } -}); - -/** -* Masquer ou afficher la sélection du logo -*/ -var formLayoutSignatureDOM = $("#formLayoutSignature"); -formLayoutSignatureDOM.on("change", function() { - if ($(this).val() !== "text") { - $("#formLayoutLogoWrapper").addClass("disabled"); - $("#formLayoutLogoWrapper").slideDown(); - $("#formLayoutLogoWidthWrapper").addClass("disabled"); - $("#formLayoutLogoWidthWrapper").slideDown(); - } else { - $("#formLayoutLogoWrapper").removeClass("disabled"); - $("#formLayoutLogoWrapper").slideUp(); - $("#formLayoutLogoWidthWrapper").removeClass("disabled"); - $("#formLayoutLogoWidthWrapper").slideUp(); - } -}); \ No newline at end of file diff --git a/module/form/view/layout/layout.css b/module/form/view/option/option.css similarity index 100% rename from module/form/view/layout/layout.css rename to module/form/view/option/option.css diff --git a/module/form/view/option/option.js.php b/module/form/view/option/option.js.php new file mode 100644 index 00000000..2148e0c6 --- /dev/null +++ b/module/form/view/option/option.js.php @@ -0,0 +1,72 @@ + + + +/* +* Affiche/cache les options de la case à cocher du mail +*/ +$("#formOptionMailOptionsToggle").on("change", function() { + if($(this).is(":checked")) { + $("#formOptionMailOptions").slideDown(); + } + else { + $("#formOptionMailOptions").slideUp(function() { + $("#formOptionGroup").val(""); + $("#formOptionSubject").val(""); + $("#formOptionMail").val(""); + $("#formOptionUser").val(""); + }); + } +}).trigger("change"); + +/** +* Affiche/cache les options de la case à cocher de la redirection +*/ +$("#formOptionPageIdToggle").on("change", function() { + if($(this).is(":checked")) { + $("#formOptionPageIdWrapper").slideDown(); + } + else { + $("#formOptionPageIdWrapper").slideUp(function() { + $("#formOptionPageId").val(""); + }); + } +}).trigger("change"); + +/** +* Paramètres par défaut au chargement +*/ +$( document ).ready(function() { + + /** + * Masquer ou afficher la sélection du logo + */ + if ($("#formOptionSignature").val() !== "text") { + $("#formOptionLogoWrapper").addClass("disabled"); + $("#formOptionLogoWrapper").slideDown(); + $("#formOptionLogoWidthWrapper").addClass("disabled"); + $("#formOptionLogoWidthWrapper").slideDown(); + } else { + $("#formOptionLogoWrapper").removeClass("disabled"); + $("#formOptionLogoWrapper").slideUp(); + $("#formOptionLogoWidthWrapper").removeClass("disabled"); + $("#formOptionLogoWidthWrapper").slideUp(); + } +}); + +/** +* Masquer ou afficher la sélection du logo +*/ +var formOptionSignatureDOM = $("#formOptionSignature"); +formOptionSignatureDOM.on("change", function() { + if ($(this).val() !== "text") { + $("#formOptionLogoWrapper").addClass("disabled"); + $("#formOptionLogoWrapper").slideDown(); + $("#formOptionLogoWidthWrapper").addClass("disabled"); + $("#formOptionLogoWidthWrapper").slideDown(); + } else { + $("#formOptionLogoWrapper").removeClass("disabled"); + $("#formOptionLogoWrapper").slideUp(); + $("#formOptionLogoWidthWrapper").removeClass("disabled"); + $("#formOptionLogoWidthWrapper").slideUp(); + } +}); \ No newline at end of file diff --git a/module/form/view/layout/layout.php b/module/form/view/option/option.php similarity index 84% rename from module/form/view/layout/layout.php rename to module/form/view/option/option.php index 83e80079..b9aa005c 100644 --- a/module/form/view/layout/layout.php +++ b/module/form/view/option/option.php @@ -1,7 +1,7 @@ - +
- 'buttonGrey', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'ico' => 'left', @@ -9,7 +9,7 @@ ]); ?>
- +
@@ -18,12 +18,12 @@

Validation du formulaire

- $this->getData(['module', $this->getUrl(0), 'config', 'captcha']) ]); ?>
- 'Laissez vide afin de conserver le texte par défaut.', 'label' => 'Etiquette du bouton de soumission', 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button']) @@ -32,12 +32,12 @@
- (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) ]); ?>
- 'displayNone', 'label' => 'Page du site :', 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) @@ -51,16 +51,16 @@

Courriel

- (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) || !empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) || !empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])), 'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.' ]); ?> -
+
- 'Laissez vide afin de conserver le texte par défaut.', 'label' => 'Sujet du mail', 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject']) @@ -73,20 +73,20 @@ ?>
- 'Aux groupes à partir de', 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']), 'help' => 'Editeurs = éditeurs + administrateurs
Membres = membres + éditeurs + administrateurs' ]); ?>
- 'A un membre', 'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers) ]); ?>
- 'A une adresse email', 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']), 'help' => 'Un email ou une liste de diffusion' @@ -95,20 +95,20 @@
- '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']) ]); ?> @@ -116,7 +116,7 @@
- (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']), 'help' => 'Cette option permet de réponse directement à l\'expéditeur du message si celui-ci a indiqué un email valide.' ]); ?>