2024-01-26 07:45:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
2024-03-09 16:34:09 +01:00
|
|
|
use Kirby\Uuid\Uuid;
|
|
|
|
|
|
2024-01-26 07:45:41 +01:00
|
|
|
return [
|
2024-01-26 13:42:00 +01:00
|
|
|
'debug' => true,
|
|
|
|
|
'panel' => [
|
|
|
|
|
'menu' => [
|
|
|
|
|
'site' => [
|
|
|
|
|
'label' => 'Accueil',
|
|
|
|
|
'current' => function ($current) {
|
2024-03-09 15:09:31 +01:00
|
|
|
$path = Kirby::instance()->request()->path()->toString();
|
|
|
|
|
return Str::contains($path, 'site');
|
2024-01-26 13:42:00 +01:00
|
|
|
}
|
|
|
|
|
],
|
2024-03-09 15:09:31 +01:00
|
|
|
'texts' => [
|
2024-03-09 11:27:10 +01:00
|
|
|
'icon' => 'pen',
|
2024-03-09 15:12:09 +01:00
|
|
|
'label' => 'Textes',
|
2024-03-09 15:09:31 +01:00
|
|
|
'link' => 'pages/texts',
|
2024-01-26 13:42:00 +01:00
|
|
|
'current' => function ($current) {
|
2024-03-09 15:09:31 +01:00
|
|
|
$path = Kirby::instance()->request()->path()->toString();
|
|
|
|
|
return Str::contains($path, 'pages/texts');
|
2024-01-26 13:42:00 +01:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
'-',
|
2024-03-09 11:27:10 +01:00
|
|
|
'infos' => [
|
|
|
|
|
'icon' => 'question',
|
|
|
|
|
'label' => 'À propos',
|
|
|
|
|
'link' => 'pages/a-propos',
|
|
|
|
|
'current' => function ($current) {
|
2024-03-09 15:09:31 +01:00
|
|
|
$path = Kirby::instance()->request()->path()->toString();
|
|
|
|
|
return Str::contains($path, 'pages/a-propos');
|
2024-03-09 11:27:10 +01:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
'newsletter' => [
|
|
|
|
|
'icon' => 'email',
|
|
|
|
|
'label' => 'Lettre',
|
|
|
|
|
'link' => 'pages/lettre',
|
|
|
|
|
'current' => function ($current) {
|
2024-03-09 15:09:31 +01:00
|
|
|
$path = Kirby::instance()->request()->path()->toString();
|
|
|
|
|
return Str::contains($path, 'pages/lettre');
|
2024-03-09 11:27:10 +01:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
'-',
|
2024-01-26 13:42:00 +01:00
|
|
|
'users',
|
2024-03-09 15:09:31 +01:00
|
|
|
'comments',
|
2024-01-26 13:42:00 +01:00
|
|
|
'system'
|
|
|
|
|
]
|
2024-03-09 16:34:09 +01:00
|
|
|
],
|
|
|
|
|
'routes' => [
|
|
|
|
|
[
|
2024-03-09 17:06:24 +01:00
|
|
|
'pattern' => 'auteurs/(:any)',
|
2024-03-09 16:34:09 +01:00
|
|
|
'action' => function ($slug) {
|
|
|
|
|
$kirby = kirby();
|
|
|
|
|
$author = getAuthorBySlug($slug);
|
|
|
|
|
|
|
|
|
|
return Page::factory([
|
|
|
|
|
'slug' => '',
|
|
|
|
|
'template' => 'author',
|
|
|
|
|
'model' => 'authors',
|
|
|
|
|
'content' => [
|
|
|
|
|
'title' => $author->name(),
|
|
|
|
|
'presentation' => $author->presentation(),
|
2024-03-09 17:06:24 +01:00
|
|
|
'author' => $author->name(),
|
2024-03-09 16:34:09 +01:00
|
|
|
'uuid' => Uuid::generate(),
|
|
|
|
|
]
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
]
|
2024-03-09 15:09:31 +01:00
|
|
|
];
|