Commit 8900add0 authored by Christian Eßl's avatar Christian Eßl Committed by Daniel Goerz
Browse files

[BUGFIX] Hide the preview button for sysfolders in list/page layout module

In the list view of a sysfolder, users could still see the page preview
button. The list view is now using the same logic as the page module
and the EditDocumentController, that allows for excluding some doktypes
from showing the preview button.

By default, the page types Recycler, Sysfolder and Spacer are excluded.
This behaviour can be overridden by setting the already available
pageTSconfig "TCEMAIN.preview.disableButtonForDokType".

Resolves: #55300
Releases: master, 9.5
Change-Id: Iad7c651e33928b3ababe84c86222291e0bb6c3cc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63515


Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent b6b62d4b
...@@ -766,7 +766,26 @@ class PageLayoutController ...@@ -766,7 +766,26 @@ class PageLayoutController
$this->buttonBar->addButton($contextSensitiveHelpButton); $this->buttonBar->addButton($contextSensitiveHelpButton);
$lang = $this->getLanguageService(); $lang = $this->getLanguageService();
// View page // View page
if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) { $pageTsConfig = BackendUtility::getPagesTSconfig($this->id);
// Exclude sysfolders, spacers and recycler by default
$excludeDokTypes = [
PageRepository::DOKTYPE_RECYCLER,
PageRepository::DOKTYPE_SYSFOLDER,
PageRepository::DOKTYPE_SPACER
];
// Custom override of values
if (isset($pageTsConfig['TCEMAIN.']['preview.']['disableButtonForDokType'])) {
$excludeDokTypes = GeneralUtility::intExplode(
',',
$pageTsConfig['TCEMAIN.']['preview.']['disableButtonForDokType'],
true
);
}
if (
!in_array((int)$this->pageinfo['doktype'], $excludeDokTypes, true)
&& !VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
) {
$languageParameter = $this->current_sys_language ? ('&L=' . $this->current_sys_language) : ''; $languageParameter = $this->current_sys_language ? ('&L=' . $this->current_sys_language) : '';
$onClick = BackendUtility::viewOnClick( $onClick = BackendUtility::viewOnClick(
$this->pageinfo['uid'], $this->pageinfo['uid'],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment