Upgrade to 3.2.5

This commit is contained in:
Bastian Allgeier
2019-09-24 11:00:59 +02:00
parent ff9b5b1861
commit 447a9dd266
234 changed files with 1990 additions and 1224 deletions

View File

@@ -21,7 +21,7 @@ return [
/**
* Changes the calendar icon to something custom
*/
'icon' => function (string $icon = "calendar") {
'icon' => function (string $icon = 'calendar') {
return $icon;
},
/**

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Toolkit\I18n;
return [
'extends' => 'text',
'props' => [

View File

@@ -1,5 +1,6 @@
<?php
use Kirby\Data\Yaml;
use Kirby\Toolkit\A;
return [
@@ -112,7 +113,7 @@ return [
$field = $this->field();
$uploads = $field->uploads();
return $field->upload($this, $uploads, function ($file) use ($field) {
return $field->upload($this, $uploads, function ($file, $parent) use ($field) {
return $file->panelPickerData([
'image' => $field->image(),
'info' => $field->info(),

View File

@@ -13,13 +13,10 @@ return [
],
'computed' => [
'text' => function () {
$text = $this->text;
if ($model = $this->model()) {
if ($text = $this->text) {
$text = $this->model()->toString($text);
return kirbytext($text);
}
return kirbytext($text);
}
],
'save' => false,

View File

@@ -19,7 +19,7 @@ return [
$self = [
'id' => $parent->id() == '' ? null : $parent->id(),
'title' => $parent->title()->value(),
'parent' => is_a($parent->parent(), Page::class) === true ? $parent->parent()->id() : null,
'parent' => is_a($parent->parent(), 'Kirby\Cms\Page') === true ? $parent->parent()->id() : null,
];
}

View File

@@ -1,5 +1,6 @@
<?php
use Kirby\Toolkit\I18n;
return [
'props' => [

View File

@@ -2,6 +2,7 @@
use Kirby\Cms\Api;
use Kirby\Cms\File;
use Kirby\Exception\Exception;
return [
'props' => [
@@ -64,7 +65,7 @@ return [
throw new Exception('The file could not be uploaded');
}
return $map($file);
return $map($file, $parent);
});
}
]

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Toolkit\Str;
return [
'props' => [
/**

View File

@@ -1,7 +1,7 @@
<?php
use Kirby\Data\Yaml;
use Kirby\Toolkit\A;
use Kirby\Toolkit\I18n;
return [
'mixins' => ['min', 'pagepicker', 'picker'],
@@ -47,6 +47,12 @@ return [
return $this->toPages($value);
},
],
'computed' => [
/**
* Unset inherited computed
*/
'default' => null
],
'methods' => [
'pageResponse' => function ($page) {
return $page->panelPickerData([

View File

@@ -1,7 +1,8 @@
<?php
use Kirby\Cms\Form;
use Kirby\Cms\Blueprint;
use Kirby\Data\Yaml;
use Kirby\Toolkit\I18n;
return [
'mixins' => ['min'],
@@ -162,7 +163,7 @@ return [
$data = [];
foreach ($value as $row) {
$data[] = $this->form($row)->data(true);
$data[] = $this->form($row)->data();
}
return $data;

View File

@@ -1,5 +1,9 @@
<?php
use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\V;
return [
'mixins' => ['min', 'options'],
'props' => [

View File

@@ -1,7 +1,6 @@
<?php
use Kirby\Exception\InvalidArgumentException;
use Kirby\Toolkit\I18n;
use Kirby\Toolkit\Str;
return [
@@ -98,6 +97,7 @@ return [
],
'validations' => [
'minlength',
'maxlength'
'maxlength',
'pattern'
]
];

View File

@@ -76,7 +76,7 @@ return [
/**
* If `false`, spellcheck will be switched off
*/
'spellcheck' => function (bool $spellcheck = false) {
'spellcheck' => function (bool $spellcheck = true) {
return $spellcheck;
},
@@ -95,10 +95,15 @@ return [
[
'pattern' => 'upload',
'action' => function () {
return $this->field()->upload($this, $this->field()->uploads(), function ($file) {
$field = $this->field();
$uploads = $field->uploads();
return $this->field()->upload($this, $uploads, function ($file, $parent) use ($field) {
$absolute = $field->model()->is($parent) === false;
return [
'filename' => $file->filename(),
'dragText' => $file->dragText(),
'dragText' => $file->dragText('auto', $absolute),
];
});
}

View File

@@ -1,6 +1,7 @@
<?php
use Kirby\Exception\InvalidArgumentException;
use Kirby\Toolkit\I18n;
return [
'props' => [
@@ -12,8 +13,8 @@ return [
/**
* Default value which will be saved when a new page/user/file is created
*/
'default' => function ($value = null) {
return $this->toBool($value);
'default' => function ($default = null) {
return $this->default = $default;
},
/**
* Sets the text next to the toggle. The text can be a string or an array of two options. The first one is the negative text and the second one the positive. The text will automatically switch when the toggle is triggered.
@@ -35,6 +36,9 @@ return [
},
],
'computed' => [
'default' => function () {
return $this->toBool($this->default);
},
'value' => function () {
if ($this->props['value'] === null) {
return $this->default();

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Toolkit\I18n;
return [
'extends' => 'text',
'props' => [

View File

@@ -1,5 +1,8 @@
<?php
use Kirby\Data\Yaml;
use Kirby\Toolkit\A;
return [
'mixins' => ['min', 'picker', 'userpicker'],
'props' => [
@@ -33,6 +36,12 @@ return [
return $this->toUsers($value);
},
],
'computed' => [
/**
* Unset inherited computed
*/
'default' => null
],
'methods' => [
'userResponse' => function ($user) {
return $user->panelPickerData([