Upgrade to 3.2.0

This commit is contained in:
Bastian Allgeier
2019-06-25 09:56:08 +02:00
parent 9e18cf635d
commit 9c89153d35
296 changed files with 14408 additions and 2504 deletions

View File

@@ -22,6 +22,9 @@ return [
'name' => function (Language $language) {
return $language->name();
},
'rules' => function (Language $language) {
return $language->rules();
},
'url' => function (Language $language) {
return $language->url();
},
@@ -32,6 +35,8 @@ return [
'code',
'default',
'name',
'rules',
'direction'
]
]
];

View File

@@ -35,6 +35,9 @@ return [
'hasDrafts' => function (Page $page) {
return $page->hasDrafts();
},
'hasFiles' => function (Page $page) {
return $page->hasFiles();
},
'id' => function (Page $page) {
return $page->id();
},
@@ -125,7 +128,6 @@ return [
'id',
'blueprint',
'content',
'errors',
'status',
'options',
'next' => ['id', 'slug', 'title'],

View File

@@ -29,6 +29,9 @@ return [
'options' => function (Site $site) {
return $site->permissions()->toArray();
},
'previewUrl' => function (Site $site) {
return $site->previewUrl();
},
'title' => function (Site $site) {
return $site->title()->value();
},
@@ -53,6 +56,7 @@ return [
'blueprint',
'content',
'options',
'previewUrl',
'url'
],
'selector' => [

View File

@@ -1,12 +1,16 @@
<?php
use Kirby\Cms\System;
use Kirby\Toolkit\Str;
/**
* System
*/
return [
'fields' => [
'ascii' => function () {
return Str::$ascii;
},
'isOk' => function (System $system) {
return $system->isOk();
},
@@ -38,6 +42,9 @@ return [
return $this->site()->title()->value();
}
},
'slugs' => function () {
return Str::$language;
},
'title' => function () {
return $this->site()->title()->value();
},
@@ -82,6 +89,7 @@ return [
'requirements'
],
'panel' => [
'ascii',
'breadcrumbTitle',
'isOk',
'isInstalled',
@@ -91,10 +99,11 @@ return [
'license',
'multilang',
'requirements',
'slugs',
'title',
'translation',
'user' => 'auth',
'version'
'version'
]
],
];

View File

@@ -11,6 +11,7 @@ return function ($kirby) {
include __DIR__ . '/routes/site.php',
include __DIR__ . '/routes/users.php',
include __DIR__ . '/routes/files.php',
include __DIR__ . '/routes/lock.php',
include __DIR__ . '/routes/system.php',
include __DIR__ . '/routes/translations.php'
);

View File

@@ -43,8 +43,14 @@ return [
'user' => $this->resolve($user)->view('auth')->toArray()
];
}
throw new NotFoundException(['key' => 'user.undefined']);
} catch (Throwable $e) {
// catch any kind of login error
if ($this->kirby()->option('debug') === true) {
throw $e;
} else {
// catch any kind of login error
}
}
throw new InvalidArgumentException('Invalid email or password');

View File

@@ -0,0 +1,52 @@
<?php
/**
* Content Lock Routes
*/
return [
[
'pattern' => '(:all)/lock',
'method' => 'GET',
'action' => function (string $path) {
return $this->parent($path)->lock()->get();
}
],
[
'pattern' => '(:all)/lock',
'method' => 'PATCH',
'action' => function (string $path) {
return $this->parent($path)->lock()->create();
}
],
[
'pattern' => '(:all)/lock',
'method' => 'DELETE',
'action' => function (string $path) {
return $this->parent($path)->lock()->remove();
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'GET',
'action' => function (string $path) {
return [
'isUnlocked' => $this->parent($path)->lock()->isUnlocked()
];
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'PATCH',
'action' => function (string $path) {
return $this->parent($path)->lock()->unlock();
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'DELETE',
'action' => function (string $path) {
return $this->parent($path)->lock()->resolve();
}
],
];

View File

@@ -62,6 +62,16 @@ return [
}
}
],
[
'pattern' => 'pages/(:any)/duplicate',
'method' => 'POST',
'action' => function (string $id) {
return $this->page($id)->duplicate($this->requestBody('slug'), [
'children' => $this->requestBody('children'),
'files' => $this->requestBody('files'),
]);
}
],
[
'pattern' => 'pages/(:any)/slug',
'method' => 'PATCH',