resolve conflict
This commit is contained in:
parent
fa34aed357
commit
d4fe38e65a
16 changed files with 92 additions and 19 deletions
|
|
@ -21,7 +21,8 @@ return [
|
|||
'routes' => [
|
||||
require(__DIR__ . '/routes/logout.php'),
|
||||
require(__DIR__ . '/routes/toggle-favorite.php'),
|
||||
require(__DIR__ . '/routes/upload-images.php')
|
||||
require(__DIR__ . '/routes/upload-images.php'),
|
||||
require(__DIR__ . '/routes/save-page.php'),
|
||||
],
|
||||
'hooks' => [
|
||||
'page.create:after' => require_once(__DIR__ . '/hooks/create-steps.php'),
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ return [
|
|||
return Str::contains($path, 'pages/projects');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'inspirations' => [
|
||||
'label' => 'Inspirations',
|
||||
'icon' => 'images',
|
||||
|
|
@ -46,6 +47,24 @@ return [
|
|||
return Str::contains($path, 'pages/inspirations');
|
||||
}
|
||||
],
|
||||
'materials' => [
|
||||
'label' => 'Matériauthèque',
|
||||
'icon' => 'images',
|
||||
'link' => 'pages/materials',
|
||||
'current' => function (string $current): bool {
|
||||
$path = Kirby\Cms\App::instance()->path();
|
||||
return Str::contains($path, 'pages/materials');
|
||||
}
|
||||
],
|
||||
'creations' => [
|
||||
'label' => 'Réalisations',
|
||||
'icon' => 'images',
|
||||
'link' => 'pages/creations',
|
||||
'current' => function (string $current): bool {
|
||||
$path = Kirby\Cms\App::instance()->path();
|
||||
return Str::contains($path, 'pages/creations');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'notifications' => [
|
||||
'label' => 'Notifications',
|
||||
|
|
|
|||
22
public/site/config/routes/save-page.php
Normal file
22
public/site/config/routes/save-page.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'pattern' => '(:all)save-page.json',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
$page = page($data->pageUri);
|
||||
|
||||
$newProperties = [];
|
||||
|
||||
foreach ($data->properties as $incomingProperty) {
|
||||
$newProperties[$incomingProperty->name] = $incomingProperty->value;
|
||||
}
|
||||
|
||||
$newPage = $page->update($newProperties);
|
||||
|
||||
return json_encode($newProperties);
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue