actuel-inactuel/site/config/config.php

85 lines
2.2 KiB
PHP
Raw Normal View History

2024-01-26 07:45:41 +01:00
<?php
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-12 17:12:03 +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',
2024-03-12 17:12:03 +01:00
'label' => 'Infolettre',
2024-03-09 11:27:10 +01:00
'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-03-12 17:12:03 +01:00
'-',
2024-01-26 13:42:00 +01:00
'users',
2024-03-09 15:09:31 +01:00
'comments',
2024-03-12 17:12:03 +01:00
'admin' => [
'icon' => 'folder',
'label' => 'Administration',
'link' => 'pages/admin',
'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/admin');
}
],
'-',
'-',
'system',
2024-01-26 13:42:00 +01:00
]
],
'routes' => [
[
2024-03-09 17:06:24 +01:00
'pattern' => 'auteurs/(:any)',
'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(),
'uuid' => Uuid::generate(),
]
]);
}
]
]
2024-03-09 15:09:31 +01:00
];