diff --git a/core/layout/common.css b/core/layout/common.css index 0dfb9bea..4f6e1469 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -1036,6 +1036,17 @@ input[type='checkbox']:disabled + label:before{ padding: 0; /* À cause du padding ajouté aux selects */ } +/* Paramètres de l'étiquette dans form */ +.formLabel { + margin-top: 20px; +} + +.formLabel hr { + border: 1px solid; + margin: 5px 0 5px; +} + + /** * Grille */ diff --git a/module/form/form.php b/module/form/form.php index 81ed0c64..8a6ac84b 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -32,14 +32,16 @@ class form extends common { public static $pagination; - const FORM_VERSION = '2.0'; + const FORM_VERSION = '2.1'; + // Objets const TYPE_MAIL = 'mail'; const TYPE_SELECT = 'select'; const TYPE_TEXT = 'text'; const TYPE_TEXTAREA = 'textarea'; - const TYPE_DATETIME = "date"; - const TYPE_CHECKBOX = "checkbox"; + const TYPE_DATETIME = 'date'; + const TYPE_CHECKBOX = 'checkbox'; + const TYPE_LABEL = 'label'; public static $types = [ @@ -48,7 +50,8 @@ class form extends common { self::TYPE_MAIL => 'Champ mail', self::TYPE_SELECT => 'Sélection', self::TYPE_DATETIME => 'Date', - self::TYPE_CHECKBOX => 'Case à cocher' + self::TYPE_CHECKBOX => 'Case à cocher', + self::TYPE_LABEL => 'Etiquette', ]; public static $listUsers = [ diff --git a/module/form/view/config/config.js.php b/module/form/view/config/config.js.php index 41a9fbbb..60977381 100644 --- a/module/form/view/config/config.js.php +++ b/module/form/view/config/config.js.php @@ -79,7 +79,9 @@ if(inputs) { * Afficher/cacher les options supplémentaires */ $(document).on("click", ".formConfigMoreToggle", function() { + $(this).parents(".formConfigInput").find(".formConfigMore").slideToggle(); + $(this).parents(".formConfigInput").find(".formConfigMoreLabel").slideToggle(); }); /** @@ -122,7 +124,10 @@ $("#formConfigInputs") .on("change", ".formConfigType", function() { var _this = $(this); if(_this.val() === "select") { - _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideDown(); + _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideDown(); + } else if ( _this.val() === "label") { + _this.parents(".formConfigInput").find("label[for*=formConfigRequired]").hide(); + _this.parents(".formConfigInput").find(".formConfigLabelWrapper").slideDown(); } else { _this.parents(".formConfigInput").find(".formConfigValuesWrapper").slideUp(); diff --git a/module/form/view/config/config.php b/module/form/view/config/config.php index 631af215..4c3c813f 100644 --- a/module/form/view/config/config.php +++ b/module/form/view/config/config.php @@ -33,12 +33,17 @@ ]); ?> +