From: Vincent Vanwaelscappel Date: Fri, 7 Jun 2019 10:47:44 +0000 (+0200) Subject: #2810 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5af869e683455064eaa2d9af4bd4683e8e0c7af1;p=cubist_cms-back.git #2810 --- diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index b91a007..a3b55dd 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -68,7 +68,7 @@ class Field 'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable, 'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'allow_null' => true, - 'fake' => false, 'store_in' => false]; + 'fake' => false, 'store_in' => false, 'attributes' => []]; } public function __construct($attributes) @@ -153,5 +153,10 @@ class Field if ($this->getAttribute('fake', false) === true) { $this->setAttributeIfNotSet('store_in', 'extras'); } + if ($this->hasAttribute('when')) { + $htmlAttributes = $this->getAttribute('attributes', []); + $htmlAttributes['data-when'] = json_encode($this->getAttribute('when')); + $this->setAttribute('attributes', $htmlAttributes); + } } } diff --git a/src/app/Magic/Fields/Range.php b/src/app/Magic/Fields/Range.php new file mode 100644 index 0000000..16d036c --- /dev/null +++ b/src/app/Magic/Fields/Range.php @@ -0,0 +1,11 @@ +