Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -24,18 +24,8 @@ return [
/**
* Default selected user(s) when a new page/file/user is created
*/
'default' => function ($default = null) {
if ($default === false) {
return [];
}
if ($default === null && $user = $this->kirby()->user()) {
return [
$this->userResponse($user)
];
}
return $this->toUsers($default);
'default' => function (string|array|bool|null $default = null) {
return $default;
},
'value' => function ($value = null) {
@@ -43,10 +33,22 @@ return [
},
],
'computed' => [
/**
* Unset inherited computed
*/
'default' => null
'default' => function (): array {
if ($this->default === false) {
return [];
}
if (
$this->default === true &&
$user = $this->kirby()->user()
) {
return [
$this->userResponse($user)
];
}
return $this->toUsers($this->default);
}
],
'methods' => [
'userResponse' => function ($user) {
@@ -57,7 +59,7 @@ return [
'text' => $this->text,
]);
},
'toUsers' => function ($value = null) {
'toUsers' => function ($value = null): array {
$users = [];
$kirby = App::instance();