From bd298b9e3a9876d6f082161989b0515071f607ac Mon Sep 17 00:00:00 2001 From: Oliver Bartsch <bo@cedev.de> Date: Thu, 18 Jul 2024 11:12:39 +0200 Subject: [PATCH] [TASK] Remove superfluous preview renderer TextPreviewRenderer and TextpicPreviewRenderer extend the StandardContentPreviewRenderer while not implementing any custom functionality and are therefore now removed. Resolves: #104417 Releases: main Change-Id: Ia99c3751405f038dbdc57b531650d7657e4a83fc Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85283 Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Oliver Bartsch <bo@cedev.de> Tested-by: core-ci <typo3@b13.com> Tested-by: Jochen Roth <rothjochen@gmail.com> Reviewed-by: Jochen Roth <rothjochen@gmail.com> --- .../Classes/Preview/TextPreviewRenderer.php | 34 -------------- .../Preview/TextpicPreviewRenderer.php | 44 ------------------- .../frontend/Configuration/TCA/tt_content.php | 2 - 3 files changed, 80 deletions(-) delete mode 100644 typo3/sysext/frontend/Classes/Preview/TextPreviewRenderer.php delete mode 100644 typo3/sysext/frontend/Classes/Preview/TextpicPreviewRenderer.php diff --git a/typo3/sysext/frontend/Classes/Preview/TextPreviewRenderer.php b/typo3/sysext/frontend/Classes/Preview/TextPreviewRenderer.php deleted file mode 100644 index fa2cecd9c4c0..000000000000 --- a/typo3/sysext/frontend/Classes/Preview/TextPreviewRenderer.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Frontend\Preview; - -use TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer; -use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem; - -/** - * Contains a preview rendering for the page module of CType="text" - * @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API. - */ -class TextPreviewRenderer extends StandardContentPreviewRenderer -{ - public function renderPageModulePreviewContent(GridColumnItem $item): string - { - $row = $item->getRecord(); - return $this->linkEditContent($this->renderText($row['bodytext'] ?? ''), $row); - } -} diff --git a/typo3/sysext/frontend/Classes/Preview/TextpicPreviewRenderer.php b/typo3/sysext/frontend/Classes/Preview/TextpicPreviewRenderer.php deleted file mode 100644 index f3a2b6cd846e..000000000000 --- a/typo3/sysext/frontend/Classes/Preview/TextpicPreviewRenderer.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Frontend\Preview; - -use TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer; -use TYPO3\CMS\Backend\Utility\BackendUtility; -use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem; - -/** - * Contains a preview rendering for the page module of CType="textpic" - * @internal this is a concrete TYPO3 hook implementation and solely used for EXT:frontend and not part of TYPO3's Core API. - */ -class TextpicPreviewRenderer extends StandardContentPreviewRenderer -{ - public function renderPageModulePreviewContent(GridColumnItem $item): string - { - $content = ''; - $row = $item->getRecord(); - if ($row['bodytext']) { - $content = $this->linkEditContent($this->renderText($row['bodytext']), $row); - } - - if ($row['image']) { - $content .= $this->linkEditContent(BackendUtility::thumbCode(row: $row, table: 'tt_content', field: 'image', linkInfoPopup: false), $row); - } - - return $content; - } -} diff --git a/typo3/sysext/frontend/Configuration/TCA/tt_content.php b/typo3/sysext/frontend/Configuration/TCA/tt_content.php index 485fc65022f3..cc32944ae871 100644 --- a/typo3/sysext/frontend/Configuration/TCA/tt_content.php +++ b/typo3/sysext/frontend/Configuration/TCA/tt_content.php @@ -1161,7 +1161,6 @@ return [ ', ], 'text' => [ - 'previewRenderer' => \TYPO3\CMS\Frontend\Preview\TextPreviewRenderer::class, 'showitem' => ' --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, --palette--;;general, @@ -1190,7 +1189,6 @@ return [ ], ], 'textpic' => [ - 'previewRenderer' => \TYPO3\CMS\Frontend\Preview\TextpicPreviewRenderer::class, 'showitem' => ' --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, --palette--;;general, -- GitLab