Skip to content

Commit

Permalink
[TASK] Simplify info boxes in page module
Browse files Browse the repository at this point in the history
Info boxes are shown in the page module for pages like
"link to external url" or "Shortcut" if a relevant field
is not filled. The current page title doesn't help at all
and is shown below anyway. Therefore it can be removed.

Resolves: #97334
Releases: main
Change-Id: I33dc90e09129827d706fe7a85781071fa0af570b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74223
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
  • Loading branch information
georgringer authored and bnf committed Apr 8, 2022
1 parent 9397f3f commit e848e62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Expand Up @@ -299,8 +299,7 @@ protected function generateMessagesForCurrentPage(): array
if ($currentDocumentType === PageRepository::DOKTYPE_SYSFOLDER && $this->moduleProvider->accessGranted('web_list', $backendUser)) {
$infoBoxes[] = [
'title' => $languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:goToListModule'),
'message' => ''
. '<p>' . $languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:goToListModuleMessage') . '</p>'
'message' => '<p>' . $languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:goToListModuleMessage') . '</p>'
. '<a class="btn btn-info" data-dispatch-action="TYPO3.ModuleMenu.showModule" data-dispatch-args-list="web_list">'
. $languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:goToListModule')
. '</a>',
Expand Down Expand Up @@ -358,15 +357,13 @@ protected function generateMessagesForCurrentPage(): array
$state = InfoboxViewHelper::STATE_ERROR;
}
$infoBoxes[] = [
'title' => $this->pageinfo['title'],
'message' => $message,
'state' => $state,
];
}
if ($currentDocumentType === PageRepository::DOKTYPE_LINK) {
if (empty($this->pageinfo['url'])) {
$infoBoxes[] = [
'title' => $this->pageinfo['title'],
'message' => $languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:pageIsMisconfiguredExternalLinkMessage'),
'state' => InfoboxViewHelper::STATE_ERROR,
];
Expand All @@ -376,7 +373,6 @@ protected function generateMessagesForCurrentPage(): array
$externalUrl = htmlspecialchars($externalUrl);
$externalUrlHtml = '<a href="' . $externalUrl . '" target="_blank" rel="noreferrer">' . $externalUrl . '</a>';
$infoBoxes[] = [
'title' => $this->pageinfo['title'],
'message' => sprintf($languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:pageIsExternalLinkMessage'), $externalUrlHtml),
'state' => InfoboxViewHelper::STATE_INFO,
];
Expand All @@ -390,15 +386,13 @@ protected function generateMessagesForCurrentPage(): array
$title = BackendUtility::getRecordTitle('pages', $contentPage);
$link = '<a href="' . htmlspecialchars((string)$linkToPid) . '">' . htmlspecialchars($title) . ' (PID ' . (int)$this->pageinfo['content_from_pid'] . ')</a>';
$infoBoxes[] = [
'title' => $title,
'message' => sprintf($languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:content_from_pid_title'), $link),
'state' => InfoboxViewHelper::STATE_INFO,
];
} else {
$links = $this->getPageLinksWhereContentIsAlsoShownOn((int)$this->pageinfo['uid']);
if (!empty($links)) {
$infoBoxes[] = [
'title' => '',
'message' => sprintf($languageService->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:content_on_pid_title'), $links),
'state' => InfoboxViewHelper::STATE_INFO,
];
Expand Down
Expand Up @@ -23,7 +23,7 @@
<typo3-immediate-action action="TYPO3.Backend.Storage.ModuleStateStorage.updateWithCurrentMount" args="{immediateActionArgs -> f:format.json() -> f:format.htmlspecialchars()}"></typo3-immediate-action>

<f:for each="{infoBoxes}" as="infoBox">
<f:be.infobox title="{infoBox.title}" state="{infoBox.state}">
<f:be.infobox state="{infoBox.state}">
<f:format.raw>{infoBox.message}</f:format.raw>
</f:be.infobox>
</f:for>
Expand Down

0 comments on commit e848e62

Please sign in to comment.