Upgrade to 4.4.0
This commit is contained in:
@@ -194,12 +194,23 @@ return [
|
||||
'page.changeTitle' => [
|
||||
'pattern' => 'pages/(:any)/changeTitle',
|
||||
'load' => function (string $id) {
|
||||
$request = App::instance()->request();
|
||||
$kirby = App::instance();
|
||||
$request = $kirby->request();
|
||||
|
||||
$page = Find::page($id);
|
||||
$permissions = $page->permissions();
|
||||
$select = $request->get('select', 'title');
|
||||
|
||||
// build the path prefix
|
||||
$path = match ($kirby->multilang()) {
|
||||
true => Str::after($kirby->site()->url(), $kirby->url()) . '/',
|
||||
false => '/'
|
||||
};
|
||||
|
||||
if ($parent = $page->parent()) {
|
||||
$path .= $parent->uri() . '/';
|
||||
}
|
||||
|
||||
return [
|
||||
'component' => 'k-form-dialog',
|
||||
'props' => [
|
||||
@@ -212,7 +223,7 @@ return [
|
||||
'slug' => Field::slug([
|
||||
'required' => true,
|
||||
'preselect' => $select === 'slug',
|
||||
'path' => $page->parent() ? '/' . $page->parent()->uri() . '/' : '/',
|
||||
'path' => $path,
|
||||
'disabled' => $permissions->can('changeSlug') === false,
|
||||
'wizard' => [
|
||||
'text' => I18n::translate('page.changeSlug.fromTitle'),
|
||||
|
Reference in New Issue
Block a user