From 40061e43bbf271a976bed4795f216332dc444332 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sat, 30 Oct 2021 14:48:05 +0200 Subject: [PATCH] simplify building theme independent plugins (#2888) --- config/packages/twig.yaml | 1 + config/services.yaml | 7 ------- src/Event/ConfigureMainMenuEvent.php | 2 +- src/EventSubscriber/MenuBuilderSubscriber.php | 2 +- tests/Event/ConfigureMainMenuEventTest.php | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 84c4669d..6f875b5d 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -7,3 +7,4 @@ twig: paths: # used in templates/emails/layout.html.twig '%kernel.project_dir%/assets/css': css + '%kernel.project_dir%/vendor/kevinpapst/adminlte-bundle/Resources/views': theme diff --git a/config/services.yaml b/config/services.yaml index 32f926cf..fd968d79 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -108,13 +108,6 @@ services: arguments: - !service { class: PDO, factory: ['@database_connection', 'getWrappedConnection'] } - # ================================================================================ - # THEME - # ================================================================================ - - KevinPapst\AdminLTEBundle\Helper\ContextHelper: - alias: admin_lte_theme.context_helper - # ================================================================================ # TIMESHEET RECORD CALCULATOR # ================================================================================ diff --git a/src/Event/ConfigureMainMenuEvent.php b/src/Event/ConfigureMainMenuEvent.php index 5dd26fb2..abf4ed61 100644 --- a/src/Event/ConfigureMainMenuEvent.php +++ b/src/Event/ConfigureMainMenuEvent.php @@ -9,8 +9,8 @@ namespace App\Event; +use App\Utils\MenuItemModel; use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent; -use KevinPapst\AdminLTEBundle\Model\MenuItemModel; use Symfony\Component\HttpFoundation\Request; use Symfony\Contracts\EventDispatcher\Event; diff --git a/src/EventSubscriber/MenuBuilderSubscriber.php b/src/EventSubscriber/MenuBuilderSubscriber.php index 487a8024..d3e0cd19 100644 --- a/src/EventSubscriber/MenuBuilderSubscriber.php +++ b/src/EventSubscriber/MenuBuilderSubscriber.php @@ -10,10 +10,10 @@ namespace App\EventSubscriber; use App\Event\ConfigureMainMenuEvent; +use App\Utils\MenuItemModel; use App\Utils\MenuItemModel as KimaiMenuItemModel; use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent; use KevinPapst\AdminLTEBundle\Model\MenuItemInterface; -use KevinPapst\AdminLTEBundle\Model\MenuItemModel; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; diff --git a/tests/Event/ConfigureMainMenuEventTest.php b/tests/Event/ConfigureMainMenuEventTest.php index 6c0292b9..35760e8d 100644 --- a/tests/Event/ConfigureMainMenuEventTest.php +++ b/tests/Event/ConfigureMainMenuEventTest.php @@ -10,8 +10,8 @@ namespace App\Tests\Event; use App\Event\ConfigureMainMenuEvent; +use App\Utils\MenuItemModel; use KevinPapst\AdminLTEBundle\Event\SidebarMenuEvent; -use KevinPapst\AdminLTEBundle\Model\MenuItemModel; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request;