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

@@ -1,8 +1,7 @@
<?php
use Kirby\Cms\File;
use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\I18n;
return [
'mixins' => [
@@ -72,9 +71,6 @@ return [
return null;
},
'dragTextType' => function () {
return (option('panel')['kirbytext'] ?? true) ? 'kirbytext' : 'markdown';
},
'parent' => function () {
return $this->parentModel();
},
@@ -84,7 +80,7 @@ return [
if ($this->sortBy) {
$files = $files->sortBy(...$files::sortArgs($this->sortBy));
} elseif ($this->sortable === true) {
$files = $files->sortBy('sort', 'asc');
$files = $files->sortBy('sort', 'asc', 'filename', 'asc');
}
// apply the default pagination
@@ -106,7 +102,7 @@ return [
$image = $file->panelImage($this->image);
$data[] = [
'dragText' => $file->dragText($this->dragTextType, $dragTextAbsolute),
'dragText' => $file->dragText('auto', $dragTextAbsolute),
'filename' => $file->filename(),
'id' => $file->id(),
'text' => $file->toString($this->text),

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Toolkit\I18n;
return [
'props' => [
/**
@@ -8,5 +10,12 @@ return [
'empty' => function ($empty = null) {
return I18n::translate($empty, $empty);
}
],
'computed' => [
'empty' => function () {
if ($this->empty) {
return $this->model()->toString($this->empty);
}
}
]
];

View File

@@ -13,7 +13,11 @@ return [
],
'computed' => [
'headline' => function () {
return $this->headline ?? ucfirst($this->name);
if ($this->headline) {
return $this->model()->toString($this->headline);
}
return ucfirst($this->name);
}
]
];

View File

@@ -10,5 +10,12 @@ return [
'help' => function ($help = null) {
return I18n::translate($help, $help);
}
],
'computed' => [
'help' => function () {
if ($this->help) {
return $this->model()->toString($this->help);
}
}
]
];

View File

@@ -1,6 +1,6 @@
<?php
use Kirby\Toolkit\Str;
use Kirby\Exception\Exception;
return [
'props' => [
@@ -22,6 +22,15 @@ return [
if (!$parent) {
throw new Exception('The parent for the query "' . $query . '" cannot be found in the section "' . $this->name() . '"');
}
if (
is_a($parent, 'Kirby\Cms\Page') === false &&
is_a($parent, 'Kirby\Cms\Site') === false &&
is_a($parent, 'Kirby\Cms\File') === false &&
is_a($parent, 'Kirby\Cms\User') === false
) {
throw new Exception('The parent for the section "' . $this->name() . '" has to be a page, site or user object');
}
}
if ($parent === null) {

View File

@@ -2,7 +2,7 @@
use Kirby\Cms\Blueprint;
use Kirby\Toolkit\A;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\I18n;
return [
'mixins' => [
@@ -80,9 +80,6 @@ return [
}
],
'computed' => [
'dragTextType' => function () {
return option('panel.kirbytext', true) ? 'kirbytext' : 'markdown';
},
'parent' => function () {
return $this->parentModel();
},
@@ -145,7 +142,7 @@ return [
$data[] = [
'id' => $item->id(),
'dragText' => $item->dragText($this->dragTextType),
'dragText' => $item->dragText(),
'text' => $item->toString($this->text),
'info' => $item->toString($this->info ?? false),
'parent' => $item->parentId(),