diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index b6a627958d9..ab00e4e4ebe 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -6,6 +6,8 @@ use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; +use TYPO3\CMS\Backend\Template\Components\Menu\Menu; +use TYPO3\CMS\Backend\Template\Components\Menu\MenuItem; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Messaging\AbstractMessage; use Psr\Http\Message\ResponseInterface; @@ -29,9 +31,9 @@ class BackendController extends ActionController implements LoggerAwareInterface use LoggerAwareTrait; public function __construct( - readonly protected QueueService $queueService, + readonly protected QueueService $queueService, readonly protected ModuleTemplateFactory $moduleTemplateFactory, - readonly protected ConfigurationService $configurationService + readonly protected ConfigurationService $configurationService ) {} public function listAction(string $filter = ''): ResponseInterface @@ -67,8 +69,8 @@ public function boostAction(bool $run = false): ResponseInterface } $viewVariables = [ 'enable' => (bool) $this->configurationService->get('boostMode'), - 'open' => \count($queueRepository->findOpen(99999999)), - 'old' => \count($queueRepository->findOldUids()), + 'open' => \count(iterator_to_array($queueRepository->findOpen(99999999))), + 'old' => \count(iterator_to_array($queueRepository->findOldUids())), ]; return $this->createModuleTemplate() @@ -171,8 +173,30 @@ protected function getCurrentUid(): int protected function createModuleTemplate(): ModuleTemplate { - return $this->moduleTemplateFactory->create($this->request) + $moduleTemplate = $this->moduleTemplateFactory->create($this->request) ->setFlashMessageQueue($this->getFlashMessageQueue()) - ->setModuleClass('tx-staticfilecache'); + ->setModuleClass('tx-staticfilecache') + ->setTitle('StaticFileCache'); + + $menuItems = [ + 'list' => 'List (Overview)', + 'boost' => 'Boostmode', + 'support' => 'Configuration, Support, Documentation...', + ]; + + $menu = new Menu(); + $menu->setIdentifier('func'); + foreach ($menuItems as $action => $label) { + $menuItem = $menu->makeMenuItem() + ->setTitle($label) + ->setHref($this->uriBuilder->uriFor($action)) + ->setActive($this->request->getControllerActionName() === $action); + + $menu->addMenuItem($menuItem); + } + + $moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu); + + return $moduleTemplate; } } diff --git a/Resources/Private/Partials/Backend/Menu.html b/Resources/Private/Partials/Backend/Menu.html deleted file mode 100644 index 0b1fdce35ed..00000000000 --- a/Resources/Private/Partials/Backend/Menu.html +++ /dev/null @@ -1,5 +0,0 @@ -
- List (Overview) - Boostmode - Configuration, Support, Documentation... -
diff --git a/Resources/Private/Templates/Backend/Boost.html b/Resources/Private/Templates/Backend/Boost.html index fb4857222c2..bb02080e62a 100644 --- a/Resources/Private/Templates/Backend/Boost.html +++ b/Resources/Private/Templates/Backend/Boost.html @@ -2,8 +2,6 @@ - -

Boostmode

diff --git a/Resources/Private/Templates/Backend/List.html b/Resources/Private/Templates/Backend/List.html index 122c342a4f4..f468902e2fa 100644 --- a/Resources/Private/Templates/Backend/List.html +++ b/Resources/Private/Templates/Backend/List.html @@ -1,9 +1,6 @@ - - -

diff --git a/Resources/Private/Templates/Backend/Support.html b/Resources/Private/Templates/Backend/Support.html index dd063891337..68303d42718 100644 --- a/Resources/Private/Templates/Backend/Support.html +++ b/Resources/Private/Templates/Backend/Support.html @@ -1,9 +1,6 @@ - - -

Support / Dokumentation