From afc3bab5319a8d54e87f46c3a41f1d5a16840e24 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Fri, 27 Feb 2026 17:36:45 +0100 Subject: [PATCH] panel : improve menu --- site/config/config.php | 3 ++- site/config/menu.php | 17 ++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/site/config/config.php b/site/config/config.php index 0448121..bb91ad5 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -66,7 +66,8 @@ return [ ], 'panel' => [ 'menu' => require_once __DIR__ . '/menu.php', - 'css' => '/assets/css/panel.css' + 'css' => '/assets/css/panel.css', + 'home' => 'pages/home', ], 'donorbox' => [ 'api_key' => '', // À remplir avec la clé API Donorbox diff --git a/site/config/menu.php b/site/config/menu.php index c0c5664..a844971 100644 --- a/site/config/menu.php +++ b/site/config/menu.php @@ -1,25 +1,16 @@ [ - 'label' => 'Dashboard', - 'icon' => 'bolt', - 'link' => '/', - 'current' => function (string $current): bool { - $path = Kirby\Cms\App::instance()->path(); - return Str::contains($path, '/site'); - } - ], - '-', 'home' => [ 'label' => 'Accueil', 'icon' => 'home', 'link' => 'pages/home', 'current' => function (string $current): bool { $path = Kirby\Cms\App::instance()->path(); - return Str::contains($path, 'pages/home'); + return $path === '' || Str::contains($path, 'pages/home'); } ], + '-', 'enquetes' => [ 'label' => 'Enquêtes', 'icon' => 'pen', @@ -40,7 +31,7 @@ return [ ], 'news' => [ 'label' => 'Brèves', - 'icon' => 'newspaper', + 'icon' => 'bell', 'link' => 'pages/news', 'current' => function (string $current): bool { $path = Kirby\Cms\App::instance()->path(); @@ -86,7 +77,7 @@ return [ ], 'legal-notices' => [ 'label' => 'Mentions légales', - 'icon' => 'email', + 'icon' => 'edit-line', 'link' => 'pages/mentions-legales', 'current' => function (string $current): bool { $path = Kirby\Cms\App::instance()->path();