Skip to content

Commit

Permalink
Add tablename to columnsOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
sfroemkenjw committed Jun 17, 2024
1 parent 79ba8da commit dfe2926
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions Classes/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
class ModuleController extends ActionController
{
private int $pageUid;
/** @var array<string, mixed> */
/** @var array<string, mixed> */
private array $exampleConfig;

public function __construct(
Expand All @@ -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
Expand Down Expand Up @@ -244,6 +245,7 @@ public function clipboardAction(

/**
* Debugs the content of the clipboard
*
* @return array<string, mixed>
*/
protected function getClipboard(string $identifier): array
Expand All @@ -263,6 +265,7 @@ protected function getClipboard(string $identifier): array

/**
* Debugs the content of the clipboard
*
* @return array<string, mixed>
*/
protected function getCurrentClipboard(): array
Expand Down Expand Up @@ -322,7 +325,12 @@ public function linksAction(): ResponseInterface
1 => 'edit',
],
],
'columnsOnly' => ['title', 'doktype'],
'columnsOnly' => [
'pages' => [
'title',
'doktype',
],
],
'returnUrl' => $returnUrl,
];
$editPagesDoktypeLink = $backendUriBuilder->buildUriFromRoute(
Expand All @@ -346,7 +354,13 @@ public function linksAction(): ResponseInterface
'season' => 'Spring',
],
],
'columnsOnly' => ['title' ,'season', 'color'],
'columnsOnly' => [
'pages' => [
'title',
'season',
'color',
],
],
];
$createHaikuLink = $backendUriBuilder->buildUriFromRoute(
'record_edit',
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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,
);

Expand Down

0 comments on commit dfe2926

Please sign in to comment.