Update Kirby and Composer dependencies

This commit is contained in:
Paul Nicoué 2022-03-22 15:39:39 +01:00
parent f5d3ea5e84
commit ec74d78ba9
382 changed files with 25077 additions and 4955 deletions

View file

@ -6,12 +6,10 @@ use Kirby\Panel\Panel;
return [
'account' => [
'pattern' => 'account',
'action' => function () {
return [
'component' => 'k-account-view',
'props' => kirby()->user()->panel()->props(),
];
},
'action' => fn () => [
'component' => 'k-account-view',
'props' => kirby()->user()->panel()->props(),
],
],
'account.file' => [
'pattern' => 'account/files/(:any)',
@ -31,10 +29,6 @@ return [
],
'account.password' => [
'pattern' => 'reset-password',
'action' => function () {
return [
'component' => 'k-reset-password-view',
];
}
'action' => fn () => ['component' => 'k-reset-password-view']
]
];

View file

@ -32,9 +32,7 @@ return function ($kirby) {
'installation.fallback' => [
'pattern' => '(:all)',
'auth' => false,
'action' => function () {
Panel::go('installation');
}
'action' => fn () => Panel::go('installation')
]
]
];

View file

@ -11,14 +11,12 @@ return [
return [
'component' => 'k-languages-view',
'props' => [
'languages' => $kirby->languages()->values(function ($language) {
return [
'default' => $language->isDefault(),
'id' => $language->code(),
'info' => Escape::html($language->code()),
'text' => Escape::html($language->name()),
];
})
'languages' => $kirby->languages()->values(fn ($language) => [
'default' => $language->isDefault(),
'id' => $language->code(),
'info' => Escape::html($language->code()),
'text' => Escape::html($language->name()),
])
]
];
}

View file

@ -200,16 +200,20 @@ return [
},
'submit' => function (string $id) {
$page = Find::page($id);
$title = trim(get('title'));
$slug = trim(get('slug'));
$title = trim(get('title', ''));
$slug = trim(get('slug', ''));
// basic input validation before we move on
if (Str::length($title) === 0) {
throw new InvalidArgumentException(['key' => 'page.changeTitle.empty']);
throw new InvalidArgumentException([
'key' => 'page.changeTitle.empty'
]);
}
if (Str::length($slug) === 0) {
throw new InvalidArgumentException(['key' => 'page.slug.invalid']);
throw new InvalidArgumentException([
'key' => 'page.slug.invalid'
]);
}
// nothing changed
@ -318,7 +322,7 @@ return [
];
},
'submit' => function () {
$title = trim(get('title'));
$title = trim(get('title', ''));
if (Str::length($title) === 0) {
throw new InvalidArgumentException([

View file

@ -7,9 +7,7 @@ $files = require __DIR__ . '/../files/dropdowns.php';
return [
'changes' => [
'pattern' => 'changes',
'options' => function () {
return Dropdown::changes();
}
'options' => fn () => Dropdown::changes()
],
'page' => [
'pattern' => 'pages/(:any)',

View file

@ -5,9 +5,7 @@ use Kirby\Cms\Find;
return [
'page' => [
'pattern' => 'pages/(:any)',
'action' => function (string $path) {
return Find::page($path)->panel()->view();
}
'action' => fn (string $path) => Find::page($path)->panel()->view()
],
'page.file' => [
'pattern' => 'pages/(:any)/files/(:any)',
@ -17,9 +15,7 @@ return [
],
'site' => [
'pattern' => 'site',
'action' => function () {
return site()->panel()->view();
}
'action' => fn () => site()->panel()->view()
],
'site.file' => [
'pattern' => 'site/files/(:any)',

View file

@ -1,5 +1,6 @@
<?php
use Kirby\Http\Server;
return [
'system' => [
@ -37,7 +38,7 @@ return [
'plugins' => $plugins,
'php' => phpversion(),
'server' => $system->serverSoftware(),
'ssl' => Server::https(),
'https' => Server::https(),
'version' => $kirby->version(),
]
];

View file

@ -25,8 +25,8 @@ return [
'link' => false,
'required' => true
]),
'password' => Field::password(),
'language' => Field::translation([
'password' => Field::password(),
'translation' => Field::translation([
'required' => true
]),
'role' => Field::role([
@ -35,11 +35,11 @@ return [
],
'submitButton' => t('create'),
'value' => [
'name' => '',
'email' => '',
'password' => '',
'language' => $kirby->panelLanguage(),
'role' => $kirby->user()->role()->name()
'name' => '',
'email' => '',
'password' => '',
'translation' => $kirby->panelLanguage(),
'role' => $kirby->user()->role()->name()
]
]
];
@ -49,7 +49,7 @@ return [
'name' => get('name'),
'email' => get('email'),
'password' => get('password'),
'language' => get('language'),
'language' => get('translation'),
'role' => get('role')
]);
return [

View file

@ -9,12 +9,10 @@ return [
'action' => function () {
$kirby = kirby();
$role = get('role');
$roles = $kirby->roles()->toArray(function ($role) {
return [
'id' => $role->id(),
'title' => $role->title(),
];
});
$roles = $kirby->roles()->toArray(fn ($role) => [
'id' => $role->id(),
'title' => $role->title(),
]);
return [
'component' => 'k-users-view',
@ -38,15 +36,13 @@ return [
]);
return [
'data' => $users->values(function ($user) {
return [
'id' => $user->id(),
'image' => $user->panel()->image(),
'info' => Escape::html($user->role()->title()),
'link' => $user->panel()->url(true),
'text' => Escape::html($user->username())
];
}),
'data' => $users->values(fn ($user) => [
'id' => $user->id(),
'image' => $user->panel()->image(),
'info' => Escape::html($user->role()->title()),
'link' => $user->panel()->url(true),
'text' => Escape::html($user->username())
]),
'pagination' => $users->pagination()->toArray()
];
},