Skip to content

Commit

Permalink
feat: regard backend user language within iframe modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jackd248 committed Jun 18, 2024
1 parent f9ee64a commit 1c2ebeb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Classes/EventListener/ModifyButtonBarEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ public function getDropdownManualButton(
'data-manual-modal' => 'open',
'data-manual-backend-url' => $this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => $pid, 'context' => 'backend']
['id' => $pid, 'context' => 'backend', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
),
])
->setHref($this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => $pid, 'context' => 'iframe']
['id' => $pid, 'context' => 'iframe', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
));
$dropdown->addItem($dropdownItem);
}
Expand All @@ -201,7 +201,7 @@ public function getDropdownManualButton(
'data-manual-modal' => 'open',
'data-manual-backend-url' => $this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => 0, 'context' => 'backend']
['id' => 0, 'context' => 'backend', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
),
])
->setIcon($this->iconFactory->getIcon('actions-notebook', Icon::SIZE_SMALL));
Expand All @@ -215,7 +215,7 @@ private function getPreviewManualButton(ModifyButtonBarEvent $event, int $pageId
$manualButton = $event->getButtonBar()->makeLinkButton();
$manualButton->setHref($this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => $pageId, 'context' => 'backend']
['id' => $pageId, 'context' => 'backend', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
));
$manualButton->setTitle($GLOBALS['LANG']->sL('LLL:EXT:xima_typo3_manual/Resources/Private/Language/locallang.xlf:button.preview'));
$manualButton->setShowLabelText(true);
Expand All @@ -231,7 +231,7 @@ public function getSmallManualButton(
$manualButton = $event->getButtonBar()->makeLinkButton();
$manualButton->setHref($this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => $pageId, 'context' => 'iframe']
['id' => $pageId, 'context' => 'iframe', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
));
$manualButton->setTitle($GLOBALS['LANG']->sL('LLL:EXT:xima_typo3_manual/Resources/Private/Language/locallang.xlf:button.dropdown.all.title'));
$manualButton->setShowLabelText(true);
Expand All @@ -240,7 +240,7 @@ public function getSmallManualButton(
'manual-modal' => 'open',
'manual-backend-url' => $this->uriBuilder->buildUriFromRoute(
'xima_typo3_manual',
['id' => $pageId, 'context' => 'backend']
['id' => $pageId, 'context' => 'backend', 'language' => $GLOBALS['BE_USER']->uc['lang'] ?? '']
),
]);
return $manualButton;
Expand Down

0 comments on commit 1c2ebeb

Please sign in to comment.