From 879e9c1c55bc8af2568daa2b41ec40fd7709f1c1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 28 Nov 2018 12:44:32 +0100 Subject: [PATCH] initial --- module/form/form.php | 12 +++++++++--- module/form/view/index/index.php | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/module/form/form.php b/module/form/form.php index 18f9bbeb..9135395a 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -31,12 +31,14 @@ class form extends common { const TYPE_SELECT = 'select'; const TYPE_TEXT = 'text'; const TYPE_TEXTAREA = 'textarea'; + const TYPE_DATETIME = "date"; 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_SELECT => 'Sélection', + self::TYPE_DATETIME => 'Sélection date' ]; /** @@ -88,7 +90,8 @@ class form extends common { $this->addOutput([ 'title' => 'Configuration du module', 'vendor' => [ - 'html-sortable' + 'html-sortable', + 'flatpickr' ], 'view' => 'config' ]); @@ -178,6 +181,9 @@ class form extends common { case self::TYPE_TEXTAREA: $filter = helper::FILTER_STRING_LONG; break; + case self::TYPE_DATE: + $filter = helper::FILTER_DATETIME; + break; default: $filter = helper::FILTER_STRING_SHORT; } @@ -230,7 +236,7 @@ class form extends common { $this->addOutput([ 'showBarEditButton' => true, 'showPageContent' => true, - 'view' => 'index' + 'view' => 'index', ]); } diff --git a/module/form/view/index/index.php b/module/form/view/index/index.php index 684ec436..0724ef9c 100755 --- a/module/form/view/index/index.php +++ b/module/form/view/index/index.php @@ -27,6 +27,13 @@ 'id' => 'formInput_' . $index, 'label' => $input['name'] ]); ?> + + 'formInput_' . $index, + 'label' => $input['name'], + 'value' => time(), + 'vendor' => 'flatpickr' + ]); ?> getData(['module', $this->getUrl(0), 'config', 'capcha'])): ?>