Upgrade to 3.7.0
This commit is contained in:
0
kirby/config/api/authentication.php
Normal file → Executable file
0
kirby/config/api/authentication.php
Normal file → Executable file
0
kirby/config/api/collections.php
Normal file → Executable file
0
kirby/config/api/collections.php
Normal file → Executable file
0
kirby/config/api/models.php
Normal file → Executable file
0
kirby/config/api/models.php
Normal file → Executable file
7
kirby/config/api/models/File.php
Normal file → Executable file
7
kirby/config/api/models/File.php
Normal file → Executable file
@@ -29,13 +29,6 @@ return [
|
||||
},
|
||||
'niceSize' => fn (File $file) => $file->niceSize(),
|
||||
'options' => fn (File $file) => $file->panel()->options(),
|
||||
'panelIcon' => function (File $file) {
|
||||
// TODO: remove in 3.7.0
|
||||
// @codeCoverageIgnoreStart
|
||||
deprecated('The API field file.panelIcon has been deprecated and will be removed in 3.7.0. Use file.panelImage instead');
|
||||
return $file->panel()->image();
|
||||
// @codeCoverageIgnoreEnd
|
||||
},
|
||||
'panelImage' => fn (File $file) => $file->panel()->image(),
|
||||
'panelUrl' => fn (File $file) => $file->panel()->url(true),
|
||||
'prev' => fn (File $file) => $file->prev(),
|
||||
|
0
kirby/config/api/models/FileBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/FileBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/FileVersion.php
Normal file → Executable file
0
kirby/config/api/models/FileVersion.php
Normal file → Executable file
0
kirby/config/api/models/Language.php
Normal file → Executable file
0
kirby/config/api/models/Language.php
Normal file → Executable file
15
kirby/config/api/models/Page.php
Normal file → Executable file
15
kirby/config/api/models/Page.php
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Kirby\Cms\Helpers;
|
||||
use Kirby\Cms\Page;
|
||||
use Kirby\Form\Form;
|
||||
|
||||
@@ -22,11 +23,12 @@ return [
|
||||
'isSortable' => fn (Page $page) => $page->isSortable(),
|
||||
/**
|
||||
* @deprecated 3.6.0
|
||||
* @todo Throw deprecated warning in 3.7.0
|
||||
* @todo Remove in 3.8.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
'next' => function (Page $page) {
|
||||
Helpers::deprecated('The API field page.next has been deprecated and will be removed in 3.8.0.');
|
||||
|
||||
return $page
|
||||
->nextAll()
|
||||
->filter('intendedTemplate', $page->intendedTemplate())
|
||||
@@ -36,24 +38,17 @@ return [
|
||||
},
|
||||
'num' => fn (Page $page) => $page->num(),
|
||||
'options' => fn (Page $page) => $page->panel()->options(['preview']),
|
||||
/**
|
||||
* @todo Remove in 3.7.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
'panelIcon' => function (Page $page) {
|
||||
deprecated('The API field page.panelIcon has been deprecated and will be removed in 3.7.0. Use page.panelImage instead');
|
||||
return $page->panel()->image();
|
||||
},
|
||||
'panelImage' => fn (Page $page) => $page->panel()->image(),
|
||||
'parent' => fn (Page $page) => $page->parent(),
|
||||
'parents' => fn (Page $page) => $page->parents()->flip(),
|
||||
/**
|
||||
* @deprecated 3.6.0
|
||||
* @todo Throw deprecated warning in 3.7.0
|
||||
* @todo Remove in 3.8.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
'prev' => function (Page $page) {
|
||||
Helpers::deprecated('The API field page.prev has been deprecated and will be removed in 3.8.0.');
|
||||
|
||||
return $page
|
||||
->prevAll()
|
||||
->filter('intendedTemplate', $page->intendedTemplate())
|
||||
|
0
kirby/config/api/models/PageBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/PageBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/Role.php
Normal file → Executable file
0
kirby/config/api/models/Role.php
Normal file → Executable file
0
kirby/config/api/models/Site.php
Normal file → Executable file
0
kirby/config/api/models/Site.php
Normal file → Executable file
0
kirby/config/api/models/SiteBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/SiteBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/System.php
Normal file → Executable file
0
kirby/config/api/models/System.php
Normal file → Executable file
0
kirby/config/api/models/Translation.php
Normal file → Executable file
0
kirby/config/api/models/Translation.php
Normal file → Executable file
0
kirby/config/api/models/User.php
Normal file → Executable file
0
kirby/config/api/models/User.php
Normal file → Executable file
0
kirby/config/api/models/UserBlueprint.php
Normal file → Executable file
0
kirby/config/api/models/UserBlueprint.php
Normal file → Executable file
0
kirby/config/api/routes.php
Normal file → Executable file
0
kirby/config/api/routes.php
Normal file → Executable file
0
kirby/config/api/routes/auth.php
Normal file → Executable file
0
kirby/config/api/routes/auth.php
Normal file → Executable file
0
kirby/config/api/routes/files.php
Normal file → Executable file
0
kirby/config/api/routes/files.php
Normal file → Executable file
0
kirby/config/api/routes/languages.php
Normal file → Executable file
0
kirby/config/api/routes/languages.php
Normal file → Executable file
47
kirby/config/api/routes/lock.php
Normal file → Executable file
47
kirby/config/api/routes/lock.php
Normal file → Executable file
@@ -5,29 +5,6 @@
|
||||
* Content Lock Routes
|
||||
*/
|
||||
return [
|
||||
[
|
||||
'pattern' => '(:all)/lock',
|
||||
'method' => 'GET',
|
||||
/**
|
||||
* @deprecated 3.6.0
|
||||
* @todo Remove in 3.7.0
|
||||
*/
|
||||
'action' => function (string $path) {
|
||||
deprecated('The `GET (:all)/lock` API endpoint has been deprecated and will be removed in 3.7.0');
|
||||
|
||||
if ($lock = $this->parent($path)->lock()) {
|
||||
return [
|
||||
'supported' => true,
|
||||
'locked' => $lock->get()
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'supported' => false,
|
||||
'locked' => null
|
||||
];
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => '(:all)/lock',
|
||||
'method' => 'PATCH',
|
||||
@@ -46,30 +23,6 @@ return [
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => '(:all)/unlock',
|
||||
'method' => 'GET',
|
||||
/**
|
||||
* @deprecated 3.6.0
|
||||
* @todo Remove in 3.7.0
|
||||
*/
|
||||
'action' => function (string $path) {
|
||||
deprecated('The `GET (:all)/unlock` API endpoint has been deprecated and will be removed in 3.7.0');
|
||||
|
||||
|
||||
if ($lock = $this->parent($path)->lock()) {
|
||||
return [
|
||||
'supported' => true,
|
||||
'unlocked' => $lock->isUnlocked()
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'supported' => false,
|
||||
'unlocked' => null
|
||||
];
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => '(:all)/unlock',
|
||||
'method' => 'PATCH',
|
||||
|
15
kirby/config/api/routes/pages.php
Normal file → Executable file
15
kirby/config/api/routes/pages.php
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Page Routes
|
||||
*/
|
||||
@@ -34,21 +35,9 @@ return [
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => [
|
||||
'pages/(:any)/blueprints',
|
||||
/**
|
||||
* @deprecated
|
||||
* @todo remove in 3.7.0
|
||||
*/
|
||||
'pages/(:any)/children/blueprints',
|
||||
],
|
||||
'pattern' => 'pages/(:any)/blueprints',
|
||||
'method' => 'GET',
|
||||
'action' => function (string $id) {
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($this->route->pattern() === 'pages/([a-zA-Z0-9\.\-_%= \+\@\(\)]+)/children/blueprints') {
|
||||
deprecated('`GET pages/(:any)/children/blueprints` API endpoint has been deprecated and will be removed in 3.7.0. Use `GET pages/(:any)/blueprints` instead');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
return $this->page($id)->blueprints($this->requestQuery('section'));
|
||||
}
|
||||
],
|
||||
|
10
kirby/config/api/routes/roles.php
Normal file → Executable file
10
kirby/config/api/routes/roles.php
Normal file → Executable file
@@ -8,13 +8,15 @@ return [
|
||||
'pattern' => 'roles',
|
||||
'method' => 'GET',
|
||||
'action' => function () {
|
||||
switch (get('canBe')) {
|
||||
$kirby = $this->kirby();
|
||||
|
||||
switch ($kirby->request()->get('canBe')) {
|
||||
case 'changed':
|
||||
return $this->kirby()->roles()->canBeChanged();
|
||||
return $kirby->roles()->canBeChanged();
|
||||
case 'created':
|
||||
return $this->kirby()->roles()->canBeCreated();
|
||||
return $kirby->roles()->canBeCreated();
|
||||
default:
|
||||
return $this->kirby()->roles();
|
||||
return $kirby->roles();
|
||||
}
|
||||
}
|
||||
],
|
||||
|
15
kirby/config/api/routes/site.php
Normal file → Executable file
15
kirby/config/api/routes/site.php
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Site Routes
|
||||
*/
|
||||
@@ -47,21 +48,9 @@ return [
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => [
|
||||
'site/blueprints',
|
||||
/**
|
||||
* @deprecated
|
||||
* @todo remove in 3.7.0
|
||||
*/
|
||||
'site/children/blueprints',
|
||||
],
|
||||
'pattern' => 'site/blueprints',
|
||||
'method' => 'GET',
|
||||
'action' => function () {
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($this->route->pattern() === 'site/children/blueprints') {
|
||||
deprecated('`GET site/children/blueprints` API endpoint has been deprecated and will be removed in 3.7.0. Use `GET site/blueprints` instead.');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
return $this->site()->blueprints($this->requestQuery('section'));
|
||||
}
|
||||
],
|
||||
|
0
kirby/config/api/routes/system.php
Normal file → Executable file
0
kirby/config/api/routes/system.php
Normal file → Executable file
0
kirby/config/api/routes/translations.php
Normal file → Executable file
0
kirby/config/api/routes/translations.php
Normal file → Executable file
0
kirby/config/api/routes/users.php
Normal file → Executable file
0
kirby/config/api/routes/users.php
Normal file → Executable file
Reference in New Issue
Block a user