From dfe2926f6e7829e47f56af10f9c32a3cde14b3b8 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Mon, 17 Jun 2024 08:16:00 +0200 Subject: [PATCH] Add tablename to columnsOnly --- Classes/Controller/ModuleController.php | 58 ++++++++++++++++++------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/Classes/Controller/ModuleController.php b/Classes/Controller/ModuleController.php index fbaf873..b9f82e4 100644 --- a/Classes/Controller/ModuleController.php +++ b/Classes/Controller/ModuleController.php @@ -52,7 +52,7 @@ class ModuleController extends ActionController { private int $pageUid; - /** @var array */ + /** @var array */ private array $exampleConfig; public function __construct( @@ -65,7 +65,8 @@ public function __construct( protected readonly ConnectionPool $connectionPool, protected readonly TableInformationService $tableInformationService, private readonly LoggerInterface $logger, - ) {} + ) { + } /** * Renders the list of all possible flash messages @@ -244,6 +245,7 @@ public function clipboardAction( /** * Debugs the content of the clipboard + * * @return array */ protected function getClipboard(string $identifier): array @@ -263,6 +265,7 @@ protected function getClipboard(string $identifier): array /** * Debugs the content of the clipboard + * * @return array */ protected function getCurrentClipboard(): array @@ -322,7 +325,12 @@ public function linksAction(): ResponseInterface 1 => 'edit', ], ], - 'columnsOnly' => ['title', 'doktype'], + 'columnsOnly' => [ + 'pages' => [ + 'title', + 'doktype', + ], + ], 'returnUrl' => $returnUrl, ]; $editPagesDoktypeLink = $backendUriBuilder->buildUriFromRoute( @@ -346,7 +354,13 @@ public function linksAction(): ResponseInterface 'season' => 'Spring', ], ], - 'columnsOnly' => ['title' ,'season', 'color'], + 'columnsOnly' => [ + 'pages' => [ + 'title', + 'season', + 'color', + ], + ], ]; $createHaikuLink = $backendUriBuilder->buildUriFromRoute( 'record_edit', @@ -573,27 +587,37 @@ protected function initializeModuleTemplate( 'flash' => [ 'controller' => 'Module', 'action' => 'flash', - 'label' => $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.flash'), + 'label' => $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.flash' + ), ], 'tree' => [ 'controller' => 'Module', 'action' => 'tree', - 'label' => $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.tree'), + 'label' => $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.tree' + ), ], 'clipboard' => [ 'controller' => 'Module', 'action' => 'clipboard', - 'label' => $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.clipboard'), + 'label' => $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.clipboard' + ), ], 'links' => [ 'controller' => 'Module', 'action' => 'links', - 'label' => $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.links'), + 'label' => $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.links' + ), ], 'fileReference' => [ 'controller' => 'Module', 'action' => 'fileReference', - 'label' => $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.fileReference'), + 'label' => $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang.xlf:module.menu.fileReference' + ), ], ]; $view = $this->moduleTemplateFactory->create($request); @@ -606,11 +630,13 @@ protected function initializeModuleTemplate( $isActive = $this->request->getControllerActionName() === $menuItemConfig['action']; $menuItem = $menu->makeMenuItem() ->setTitle($menuItemConfig['label']) - ->setHref($this->uriBuilder->reset()->uriFor( - $menuItemConfig['action'], - [], - $menuItemConfig['controller'], - )) + ->setHref( + $this->uriBuilder->reset()->uriFor( + $menuItemConfig['action'], + [], + $menuItemConfig['controller'], + ) + ) ->setActive($isActive); $menu->addMenuItem($menuItem); if ($isActive) { @@ -621,7 +647,9 @@ protected function initializeModuleTemplate( $view->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu); $view->setTitle( - $this->getLanguageService()->sL('LLL:EXT:examples/Resources/Private/Language/Module/locallang_mod.xlf:mlang_tabs_tab'), + $this->getLanguageService()->sL( + 'LLL:EXT:examples/Resources/Private/Language/Module/locallang_mod.xlf:mlang_tabs_tab' + ), $context, );