Upgrade to 3.2.5
This commit is contained in:
@@ -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),
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
]
|
||||
];
|
||||
|
@@ -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);
|
||||
}
|
||||
]
|
||||
];
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
]
|
||||
];
|
||||
|
@@ -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) {
|
||||
|
@@ -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(),
|
||||
|
Reference in New Issue
Block a user