Update Composer packages
This commit is contained in:
parent
df93324906
commit
45bdef9a3b
378 changed files with 28466 additions and 28852 deletions
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\Page;
|
||||
use Kirby\Cms\Site;
|
||||
use Kirby\Form\Form;
|
||||
|
||||
return [
|
||||
|
@ -31,7 +33,10 @@ return [
|
|||
'fields' => function () {
|
||||
$fields = $this->form->fields()->toArray();
|
||||
|
||||
if (is_a($this->model, 'Kirby\Cms\Page') === true || is_a($this->model, 'Kirby\Cms\Site') === true) {
|
||||
if (
|
||||
$this->model instanceof Page ||
|
||||
$this->model instanceof Site
|
||||
) {
|
||||
// the title should never be updated directly via
|
||||
// fields section to avoid conflicts with the rename dialog
|
||||
unset($fields['title']);
|
||||
|
|
|
@ -25,9 +25,9 @@ return [
|
|||
],
|
||||
'toArray' => function () {
|
||||
return [
|
||||
'headline' => $this->headline,
|
||||
'text' => $this->text,
|
||||
'theme' => $this->theme
|
||||
'label' => $this->headline,
|
||||
'text' => $this->text,
|
||||
'theme' => $this->theme
|
||||
];
|
||||
}
|
||||
];
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\Helpers;
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
||||
return [
|
||||
'props' => [
|
||||
/**
|
||||
* The headline for the section. This can be a simple string or a template with additional info from the parent page.
|
||||
* @todo remove in 3.9.0
|
||||
* @deprecated 3.8.0 Use `label` instead
|
||||
*/
|
||||
'headline' => function ($headline = null) {
|
||||
// TODO: add deprecation notive in 3.8.0
|
||||
// if ($headline !== null) {
|
||||
// Helpers::deprecated('`headline` prop for sections has been deprecated and will be removed in Kirby 3.9.0. Use `label` instead.');
|
||||
// }
|
||||
|
||||
return I18n::translate($headline, $headline);
|
||||
},
|
||||
/**
|
||||
|
@ -28,14 +22,14 @@ return [
|
|||
],
|
||||
'computed' => [
|
||||
'headline' => function () {
|
||||
if ($this->headline) {
|
||||
return $this->model()->toString($this->headline);
|
||||
}
|
||||
|
||||
if ($this->label) {
|
||||
return $this->model()->toString($this->label);
|
||||
}
|
||||
|
||||
if ($this->headline) {
|
||||
return $this->model()->toString($this->headline);
|
||||
}
|
||||
|
||||
return ucfirst($this->name);
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\File;
|
||||
use Kirby\Cms\Page;
|
||||
use Kirby\Cms\Site;
|
||||
use Kirby\Cms\User;
|
||||
use Kirby\Exception\Exception;
|
||||
|
||||
return [
|
||||
|
@ -24,10 +28,10 @@ return [
|
|||
}
|
||||
|
||||
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
|
||||
$parent instanceof Page === false &&
|
||||
$parent instanceof Site === false &&
|
||||
$parent instanceof File === false &&
|
||||
$parent instanceof User === false
|
||||
) {
|
||||
throw new Exception('The parent for the section "' . $this->name() . '" has to be a page, site or user object');
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ return [
|
|||
}
|
||||
],
|
||||
'methods' => [
|
||||
'searchterm' => function (): ?string {
|
||||
'searchterm' => function (): string|null {
|
||||
return App::instance()->request()->get('searchterm');
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\Blueprint;
|
||||
use Kirby\Cms\Page;
|
||||
use Kirby\Cms\Site;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Toolkit\A;
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
@ -53,8 +55,8 @@ return [
|
|||
$parent = $this->parentModel();
|
||||
|
||||
if (
|
||||
is_a($parent, 'Kirby\Cms\Site') === false &&
|
||||
is_a($parent, 'Kirby\Cms\Page') === false
|
||||
$parent instanceof Site === false &&
|
||||
$parent instanceof Page === false
|
||||
) {
|
||||
throw new InvalidArgumentException('The parent is invalid. You must choose the site or a page as parent.');
|
||||
}
|
||||
|
@ -62,22 +64,13 @@ return [
|
|||
return $parent;
|
||||
},
|
||||
'pages' => function () {
|
||||
switch ($this->status) {
|
||||
case 'draft':
|
||||
$pages = $this->parent->drafts();
|
||||
break;
|
||||
case 'listed':
|
||||
$pages = $this->parent->children()->listed();
|
||||
break;
|
||||
case 'published':
|
||||
$pages = $this->parent->children();
|
||||
break;
|
||||
case 'unlisted':
|
||||
$pages = $this->parent->children()->unlisted();
|
||||
break;
|
||||
default:
|
||||
$pages = $this->parent->childrenAndDrafts();
|
||||
}
|
||||
$pages = match ($this->status) {
|
||||
'draft' => $this->parent->drafts(),
|
||||
'listed' => $this->parent->children()->listed(),
|
||||
'published' => $this->parent->children(),
|
||||
'unlisted' => $this->parent->children()->unlisted(),
|
||||
default => $this->parent->childrenAndDrafts()
|
||||
};
|
||||
|
||||
// filters pages that are protected and not in the templates list
|
||||
// internal `filter()` method used instead of foreach loop that previously included `unset()`
|
||||
|
@ -228,7 +221,7 @@ return [
|
|||
'name' => basename($props['name']),
|
||||
'title' => $props['title'],
|
||||
];
|
||||
} catch (Throwable $e) {
|
||||
} catch (Throwable) {
|
||||
$blueprints[] = [
|
||||
'name' => basename($template),
|
||||
'title' => ucfirst($template),
|
||||
|
|
|
@ -47,10 +47,12 @@ return [
|
|||
continue;
|
||||
}
|
||||
|
||||
$info = $report['info'] ?? null;
|
||||
|
||||
$reports[] = [
|
||||
'label' => I18n::translate($report['label'], $report['label']),
|
||||
'value' => $value($report['value'] ?? null),
|
||||
'info' => $value($report['info'] ?? null),
|
||||
'info' => $value(I18n::translate($info, $info)),
|
||||
'link' => $value($report['link'] ?? null),
|
||||
'theme' => $value($report['theme'] ?? null)
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue