Upgrade to 3.1.2

This commit is contained in:
Bastian Allgeier
2019-04-09 14:34:12 +02:00
parent 852a14595e
commit eb29ef6d6c
58 changed files with 535 additions and 258 deletions

View File

@@ -4,7 +4,7 @@ use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
return [
'mixins' => ['options'],
'mixins' => ['min', 'options'],
'props' => [
/**
* Unset inherited props

View File

@@ -3,6 +3,7 @@
use Kirby\Toolkit\A;
return [
'mixins' => ['min'],
'props' => [
/**
* Unset inherited props

View File

@@ -0,0 +1,22 @@
<?php
return [
'computed' => [
'min' => function () {
// set min to at least 1, if required
if ($this->required === true) {
return $this->min ?? 1;
}
return $this->min;
},
'required' => function () {
// set required to true if min is set
if ($this->min) {
return true;
}
return $this->required;
}
]
];

View File

@@ -4,6 +4,7 @@ use Kirby\Toolkit\A;
use Kirby\Toolkit\I18n;
return [
'mixins' => ['min'],
'props' => [
/**
* Unset inherited props

View File

@@ -4,6 +4,7 @@ use Kirby\Cms\Form;
use Kirby\Cms\Blueprint;
return [
'mixins' => ['min'],
'props' => [
/**
* Unset inherited props
@@ -28,6 +29,14 @@ return [
'empty' => function ($empty = null) {
return I18n::translate($empty, $empty);
},
/**
* Set the default rows for the structure
*/
'default' => function (array $default = null) {
return $default;
},
/**
* Fields setup for the structure form. Works just like fields in regular forms.
*/
@@ -113,7 +122,7 @@ return [
}
return $columns;
},
}
],
'methods' => [
'rows' => function ($value) {
@@ -149,11 +158,11 @@ return [
]
];
},
'save' => function () {
'save' => function ($value) {
$data = [];
foreach ($this->value() as $row) {
$data[] = $this->form($row)->data();
foreach ($value as $row) {
$data[] = $this->form($row)->data(true);
}
return $data;

View File

@@ -1,7 +1,7 @@
<?php
return [
'mixins' => ['options'],
'mixins' => ['min', 'options'],
'props' => [
/**

View File

@@ -9,7 +9,7 @@ return [
'before' => null,
/**
* Enables/disables the format buttons. Can either be true/false or a list of allowed buttons. Available buttons: headlines, italic, bold, link, email, list, code, ul, ol
* Enables/disables the format buttons. Can either be true/false or a list of allowed buttons. Available buttons: headlines, italic, bold, link, email, file, list, code, ul, ol
*/
'buttons' => function ($buttons = true) {
return $buttons;

View File

@@ -1,6 +1,7 @@
<?php
return [
'mixins' => ['min'],
'props' => [
/**
* Unset inherited props