diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index de3231ff706f24b7afc7b38bb6c527525f055db2..ba560d93af8886e697a632b7fc238b4e4297ede6 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -693,17 +693,15 @@ class PageLayoutController } $content .= $tableOutput; // Making search form: - if (!$this->modTSconfig['properties']['disableSearchBox']) { - $this->searchContent = $this->getSearchBox(); - if ($this->searchContent) { - $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox'); - $toggleSearchFormButton = $this->buttonBar->makeLinkButton() - ->setClasses('t3js-toggle-search-toolbox') - ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.title.searchIcon')) - ->setIcon($this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL)) - ->setHref('#'); - $this->buttonBar->addButton($toggleSearchFormButton, ButtonBar::BUTTON_POSITION_LEFT, 4); - } + $this->searchContent = $this->getSearchBox(); + if ($this->searchContent) { + $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox'); + $toggleSearchFormButton = $this->buttonBar->makeLinkButton() + ->setClasses('t3js-toggle-search-toolbox') + ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.title.searchIcon')) + ->setIcon($this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL)) + ->setHref('#'); + $this->buttonBar->addButton($toggleSearchFormButton, ButtonBar::BUTTON_POSITION_LEFT, 4); } // Additional footer content foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook'] ?? [] as $hook) { @@ -788,70 +786,68 @@ class PageLayoutController ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL)); $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1); - if (empty($this->modTSconfig['properties']['disableIconToolbar'])) { - // Edit page properties and page language overlay icons - if ($this->isPageEditable(0)) { - /** @var \TYPO3\CMS\Core\Http\NormalizedParams */ - $normalizedParams = $request->getAttribute('normalizedParams'); - // Edit localized pages only when one specific language is selected - if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) { - $localizationParentField = $GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']; - $languageField = $GLOBALS['TCA']['pages']['ctrl']['languageField']; - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) - ->getQueryBuilderForTable('pages'); - $queryBuilder->getRestrictions() - ->removeAll() - ->add(GeneralUtility::makeInstance(DeletedRestriction::class)) - ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, (int)$this->getBackendUser()->workspace)); - $overlayRecord = $queryBuilder - ->select('uid') - ->from('pages') - ->where( - $queryBuilder->expr()->eq( - $localizationParentField, - $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT) - ), - $queryBuilder->expr()->eq( - $languageField, - $queryBuilder->createNamedParameter($this->current_sys_language, \PDO::PARAM_INT) - ) + // Edit page properties and page language overlay icons + if ($this->isPageEditable(0)) { + /** @var \TYPO3\CMS\Core\Http\NormalizedParams */ + $normalizedParams = $request->getAttribute('normalizedParams'); + // Edit localized pages only when one specific language is selected + if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) { + $localizationParentField = $GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']; + $languageField = $GLOBALS['TCA']['pages']['ctrl']['languageField']; + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) + ->getQueryBuilderForTable('pages'); + $queryBuilder->getRestrictions() + ->removeAll() + ->add(GeneralUtility::makeInstance(DeletedRestriction::class)) + ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, (int)$this->getBackendUser()->workspace)); + $overlayRecord = $queryBuilder + ->select('uid') + ->from('pages') + ->where( + $queryBuilder->expr()->eq( + $localizationParentField, + $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT) + ), + $queryBuilder->expr()->eq( + $languageField, + $queryBuilder->createNamedParameter($this->current_sys_language, \PDO::PARAM_INT) ) - ->setMaxResults(1) - ->execute() - ->fetch(); - BackendUtility::workspaceOL('pages', $overlayRecord, (int)$this->getBackendUser()->workspace); - // Edit button - $urlParameters = [ - 'edit' => [ - 'pages' => [ - $overlayRecord['uid'] => 'edit' - ] - ], - 'returnUrl' => $normalizedParams->getRequestUri(), - ]; - - $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters); - $editLanguageButton = $this->buttonBar->makeLinkButton() - ->setHref($url) - ->setTitle($lang->getLL('editPageLanguageOverlayProperties')) - ->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)); - $this->buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3); - } + ) + ->setMaxResults(1) + ->execute() + ->fetch(); + BackendUtility::workspaceOL('pages', $overlayRecord, (int)$this->getBackendUser()->workspace); + // Edit button $urlParameters = [ 'edit' => [ 'pages' => [ - $this->id => 'edit' + $overlayRecord['uid'] => 'edit' ] ], 'returnUrl' => $normalizedParams->getRequestUri(), ]; + $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters); - $editPageButton = $this->buttonBar->makeLinkButton() + $editLanguageButton = $this->buttonBar->makeLinkButton() ->setHref($url) - ->setTitle($lang->getLL('editPageProperties')) - ->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)); - $this->buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3); + ->setTitle($lang->getLL('editPageLanguageOverlayProperties')) + ->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)); + $this->buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3); } + $urlParameters = [ + 'edit' => [ + 'pages' => [ + $this->id => 'edit' + ] + ], + 'returnUrl' => $normalizedParams->getRequestUri(), + ]; + $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters); + $editPageButton = $this->buttonBar->makeLinkButton() + ->setHref($url) + ->setTitle($lang->getLL('editPageProperties')) + ->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)); + $this->buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3); } } diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-93077-RemovedUnneededConfigurationsInPageLayoutView.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-93077-RemovedUnneededConfigurationsInPageLayoutView.rst new file mode 100644 index 0000000000000000000000000000000000000000..d917a7b070b2b07586cf8b5b1d86e0caad51c567 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-93077-RemovedUnneededConfigurationsInPageLayoutView.rst @@ -0,0 +1,36 @@ +.. include:: ../../Includes.txt + +==================================================================== +Breaking: #93077 - Removed unneeded configurations in PageLayoutView +==================================================================== + +See :issue:`93077` + +Description +=========== + +The following TSconfig settings have been removed in favor of strong defaults and less configuration: + +- :ts:`mod.web_layout.disableIconToolbar` +- :ts:`mod.web_layout.disableSearchBox` + + +Impact +====== + +The settings :ts:`mod.web_layout.disableIconToolbar` and :ts:`mod.web_layout.disableSearchBox` are +not evaluated anymore and the edit button and the searchbox are always shown in the page module. + + +Affected Installations +====================== + +TYPO3 installations using the settings :ts:`mod.web_layout.disableIconToolbar` or :ts:`mod.web_layout.disableSearchBox`. + + +Migration +========= + +There is no migration possible. + +.. index:: Backend, TSConfig, NotScanned, ext:backend