diff --git a/module/form/form.php b/module/form/form.php index 40a62c86..e470c75a 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -32,13 +32,15 @@ class form extends common { const TYPE_TEXT = 'text'; const TYPE_TEXTAREA = 'textarea'; const TYPE_DATETIME = "date"; + CONST TYPE_CHECKBOX = "checkbox"; public static $types = [ self::TYPE_TEXT => 'Champ texte', self::TYPE_TEXTAREA => 'Grand champ texte', self::TYPE_MAIL => 'Champ mail', self::TYPE_SELECT => 'Sélection', - self::TYPE_DATETIME => 'Date' + self::TYPE_DATETIME => 'Date', + self::TYPE_CHECKBOX => 'Case à cocher' ]; /** @@ -184,6 +186,9 @@ class form extends common { case self::TYPE_DATETIME: $filter = helper::FILTER_STRING_SHORT; // Mettre TYPE_DATETIME pour récupérer un TIMESTAMP break; + CASE self::TYPE_CHECKBOX: + $filter = helper::FILTER_BOOLEAN; + break; default: $filter = helper::FILTER_STRING_SHORT; } diff --git a/module/form/view/index/index.php b/module/form/view/index/index.php index 79e92f34..6c65b6cf 100755 --- a/module/form/view/index/index.php +++ b/module/form/view/index/index.php @@ -32,7 +32,10 @@ 'id' => 'formInput_' . $index, 'label' => $input['name'], 'vendor' => 'flatpickr' - ]); ?> + ]); ?> + + getData(['module', $this->getUrl(0), 'config', 'capcha'])): ?>