From c08c298b99ee7294db9f337a3e8c089f408cfbc5 Mon Sep 17 00:00:00 2001 From: Christian Kuhn <lolli@schwarzbu.ch> Date: Sun, 28 Nov 2021 18:49:50 +0100 Subject: [PATCH] [!!!][TASK] Remove ext:backend ModuleLayout view helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: #96126 Related: #94209 Releases: master Change-Id: If2edcfdbf6ab2e206c43c634fa58ccf75c75ab38 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72343 Tested-by: core-ci <typo3@b13.com> Tested-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Benni Mack <benni@typo3.org> --- .../Button/AbstractButtonViewHelper.php | 106 ----------------- .../Button/LinkButtonViewHelper.php | 60 ---------- .../Button/ShortcutButtonViewHelper.php | 102 ----------------- .../ModuleLayout/MenuItemViewHelper.php | 97 ---------------- .../ModuleLayout/MenuViewHelper.php | 101 ----------------- .../ViewHelpers/ModuleLayoutViewHelper.php | 107 ------------------ ...g-96107-DeprecatedFunctionalityRemoved.rst | 7 +- .../ExtensionScanner/Php/ClassNameMatcher.php | 6 + 8 files changed, 11 insertions(+), 575 deletions(-) delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/AbstractButtonViewHelper.php delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/LinkButtonViewHelper.php delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/ShortcutButtonViewHelper.php delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuItemViewHelper.php delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuViewHelper.php delete mode 100644 typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/AbstractButtonViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/AbstractButtonViewHelper.php deleted file mode 100644 index 821dbf3db1c2..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/AbstractButtonViewHelper.php +++ /dev/null @@ -1,106 +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\Backend\ViewHelpers\ModuleLayout\Button; - -use TYPO3\CMS\Backend\Template\Components\ButtonBar; -use TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton; -use TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface; -use TYPO3\CMS\Backend\Template\ModuleTemplate; -use TYPO3\CMS\Backend\ViewHelpers\ModuleLayoutViewHelper; -use TYPO3\CMS\Core\Imaging\Icon; -use TYPO3\CMS\Core\Imaging\IconFactory; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; -use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer; -use TYPO3Fluid\Fluid\View\Exception; - -/** - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. - */ -abstract class AbstractButtonViewHelper extends AbstractViewHelper -{ - use CompileWithRenderStatic; - - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments(): void - { - $this->registerArgument('icon', 'string', 'Icon identifier for the button'); - $this->registerArgument('title', 'string', 'Title of the button'); - $this->registerArgument('disabled', 'bool', 'Whether the button is disabled', false, false); - $this->registerArgument('showLabel', 'bool', 'Defines whether to show the title as a label within the button', false, false); - $this->registerArgument('position', 'string', 'Position of the button (left or right)'); - $this->registerArgument('group', 'integer', 'Button group of the button'); - } - - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @throws \InvalidArgumentException - * @throws \TYPO3Fluid\Fluid\View\Exception - */ - public static function renderStatic( - array $arguments, - \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext - ): void { - trigger_error(__CLASS__ . ' will be removed in TYPO3 v12.', E_USER_DEPRECATED); - $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer(); - self::ensureProperNesting($viewHelperVariableContainer); - - /** @var ModuleTemplate $moduleTemplate */ - $moduleTemplate = $viewHelperVariableContainer->get(ModuleLayoutViewHelper::class, ModuleTemplate::class); - $buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar(); - - $position = $arguments['position'] ?? ButtonBar::BUTTON_POSITION_LEFT; - $group = $arguments['group'] ?? 1; - $button = static::createButton($buttonBar, $arguments, $renderingContext); - if ($button instanceof AbstractButton) { - self::addDefaultAttributes($button, $arguments, $renderingContext); - } - $buttonBar->addButton($button, $position, $group); - } - - abstract protected static function createButton(ButtonBar $buttonBar, array $arguments, RenderingContextInterface $renderingContext): ButtonInterface; - - /** - * @param ViewHelperVariableContainer $viewHelperVariableContainer - * @throws Exception - */ - private static function ensureProperNesting(ViewHelperVariableContainer $viewHelperVariableContainer): void - { - if (!$viewHelperVariableContainer->exists(ModuleLayoutViewHelper::class, ModuleTemplate::class)) { - throw new Exception(sprintf('%s must be nested in <f.be.moduleLayout> ViewHelper', self::class), 1531216505); - } - } - - private static function addDefaultAttributes(AbstractButton $button, array $arguments, RenderingContextInterface $renderingContext): void - { - $button->setShowLabelText($arguments['showLabel']); - if (isset($arguments['title'])) { - $button->setTitle($arguments['title']); - } - $button->setIcon(GeneralUtility::makeInstance(IconFactory::class)->getIcon($arguments['icon'], Icon::SIZE_SMALL)); - } -} diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/LinkButtonViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/LinkButtonViewHelper.php deleted file mode 100644 index 2ce723b981ad..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/LinkButtonViewHelper.php +++ /dev/null @@ -1,60 +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\Backend\ViewHelpers\ModuleLayout\Button; - -use TYPO3\CMS\Backend\Template\Components\ButtonBar; -use TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; - -/** - * A ViewHelper for adding a link button to the doc header area. - * It must be a child of :ref:`<be:moduleLayout> <typo3-backend-modulelayout>`. - * - * Examples - * -------- - * - * Default:: - * - * <be:moduleLayout> - * <be:moduleLayout.button.linkButton - * icon="actions-add" - * title="Add record')}" - * link="{be:uri.newRecord(table: 'tx_my_table')}" - * /> - * </be:moduleLayout> - * - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. Deprecation logged AbstractButtonViewHelper. - */ -class LinkButtonViewHelper extends AbstractButtonViewHelper -{ - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments(): void - { - parent::initializeArguments(); - $this->registerArgument('link', 'string', 'Link for the button', true); - } - - protected static function createButton(ButtonBar $buttonBar, array $arguments, RenderingContextInterface $renderingContext): ButtonInterface - { - return $buttonBar->makeLinkButton()->setHref($arguments['link']); - } -} diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/ShortcutButtonViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/ShortcutButtonViewHelper.php deleted file mode 100644 index 9db29961ac80..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/ShortcutButtonViewHelper.php +++ /dev/null @@ -1,102 +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\Backend\ViewHelpers\ModuleLayout\Button; - -use TYPO3\CMS\Backend\Routing\Router; -use TYPO3\CMS\Backend\Template\Components\ButtonBar; -use TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Service\ExtensionService; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; - -/** - * A ViewHelper for adding a shortcut button to the doc header area. - * It must be a child of :ref:`<be:moduleLayout> <typo3-backend-modulelayout>`. - * - * The 'arguments' argument should contain key/value pairs of all arguments - * relevant for the specific view. - * - * Examples - * -------- - * - * Default:: - * - * <be:moduleLayout> - * <be:moduleLayout.button.shortcutButton displayName="Shortcut label" arguments="{parameter: '{someValue}'}"/> - * </be:moduleLayout> - * - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. Deprecation logged AbstractButtonViewHelper. - */ -class ShortcutButtonViewHelper extends AbstractButtonViewHelper -{ - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments(): void - { - parent::initializeArguments(); - $this->registerArgument('displayName', 'string', 'Name for the shortcut', false, ''); - $this->registerArgument('arguments', 'array', 'List of relevant GET variables as key/values list to store', false, []); - $this->registerArgument('getVars', 'array', 'List of additional GET variables to store. The current id, module and all module arguments will always be stored', false, []); - } - - protected static function createButton(ButtonBar $buttonBar, array $arguments, RenderingContextInterface $renderingContext): ButtonInterface - { - $currentRequest = $renderingContext->getRequest(); - $moduleName = $currentRequest->getPluginName(); - $displayName = $arguments['displayName']; - - // Initialize the shortcut button - $shortcutButton = $buttonBar - ->makeShortcutButton() - ->setDisplayName($displayName) - ->setRouteIdentifier(self::getRouteIdentifierForModuleName($moduleName)); - - if (!empty($arguments['arguments'])) { - $shortcutButton->setArguments($arguments['arguments']); - } else { - $extensionName = $currentRequest->getControllerExtensionName(); - $argumentPrefix = GeneralUtility::makeInstance(ExtensionService::class) - ->getPluginNamespace($extensionName, $moduleName); - $getVars = $arguments['getVars']; - $getVars[] = $argumentPrefix; - $shortcutButton->setGetVariables($getVars); - } - - return $shortcutButton; - } - - /** - * Tries to fetch the route identifier for a given module name - * - * @param string $moduleName - * @return string - */ - protected static function getRouteIdentifierForModuleName(string $moduleName): string - { - foreach (GeneralUtility::makeInstance(Router::class)->getRoutes() as $identifier => $route) { - if ($route->hasOption('moduleName') && $route->getOption('moduleName') === $moduleName) { - return $identifier; - } - } - - return ''; - } -} diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuItemViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuItemViewHelper.php deleted file mode 100644 index 09e172f5bef3..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuItemViewHelper.php +++ /dev/null @@ -1,97 +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\Backend\ViewHelpers\ModuleLayout; - -use TYPO3\CMS\Backend\Template\Components\Menu\Menu; -use TYPO3\CMS\Backend\ViewHelpers\ModuleLayoutViewHelper; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; -use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer; -use TYPO3Fluid\Fluid\View\Exception; - -/** - * A ViewHelper for adding a menu item to a doc header menu. - * It must be a child of :ref:`<be:moduleLayout.menu> <typo3-backend-modulelayout-menu>`. - * - * Examples - * ======== - * - * Default:: - * - * <be:moduleLayout> - * <be:moduleLayout.menu identifier="MenuIdentifier"> - * <be:moduleLayout.menuItem label="Menu item 1" uri="{f:uri.action(action: 'index')}"/> - * </be:moduleLayout.menu> - * </be:moduleLayout> - * - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. - */ -class MenuItemViewHelper extends AbstractViewHelper -{ - use CompileWithRenderStatic; - - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments() - { - parent::initializeArguments(); - $this->registerArgument('label', 'string', 'Label of the menu item', true); - $this->registerArgument('uri', 'string', 'Action uri', true); - } - - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @throws Exception - * @throws \InvalidArgumentException - */ - public static function renderStatic( - array $arguments, - \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext - ) { - trigger_error(__CLASS__ . ' will be removed in TYPO3 v12.', E_USER_DEPRECATED); - $request = $renderingContext->getRequest(); - $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer(); - self::ensureProperNesting($viewHelperVariableContainer); - - /** @var Menu $menu */ - $menu = $viewHelperVariableContainer->get(ModuleLayoutViewHelper::class, Menu::class); - $menuItem = $menu->makeMenuItem(); - $menuItem->setTitle($arguments['label']); - $menuItem->setHref($arguments['uri']); - $menuItem->setActive($request->getAttribute('normalizedParams')->getRequestUri() === $arguments['uri']); - $menu->addMenuItem($menuItem); - } - - /** - * @param ViewHelperVariableContainer $viewHelperVariableContainer - * @throws Exception - */ - private static function ensureProperNesting(ViewHelperVariableContainer $viewHelperVariableContainer): void - { - if (!$viewHelperVariableContainer->exists(ModuleLayoutViewHelper::class, Menu::class)) { - throw new Exception(sprintf('%s must be nested in <f.be.moduleLayout.menu> ViewHelper', self::class), 1531235592); - } - } -} diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuViewHelper.php deleted file mode 100644 index d99faecc8faf..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuViewHelper.php +++ /dev/null @@ -1,101 +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\Backend\ViewHelpers\ModuleLayout; - -use TYPO3\CMS\Backend\Template\Components\Menu\Menu; -use TYPO3\CMS\Backend\Template\ModuleTemplate; -use TYPO3\CMS\Backend\ViewHelpers\ModuleLayoutViewHelper; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; -use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer; -use TYPO3Fluid\Fluid\View\Exception; - -/** - * A ViewHelper for adding a menu to the doc header area - * of :ref:`<be:moduleLayout> <typo3-backend-modulelayout>`. It accepts only - * :ref:`<be:moduleLayout.menuItem> <typo3-backend-modulelayout-menuitem>` view - * helpers as children. - * - * Examples - * ======== - * - * Default:: - * - * <be:moduleLayout> - * <be:moduleLayout.menu identifier="MenuIdentifier"> - * <be:moduleLayout.menuItem label="Menu item 1" uri="{f:uri.action(action: 'index')}"/> - * </be:moduleLayout.menu> - * </be:moduleLayout> - * - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. - */ -class MenuViewHelper extends AbstractViewHelper -{ - use CompileWithRenderStatic; - - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments() - { - $this->registerArgument('identifier', 'string', 'Identifier of the menu', true); - } - - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @throws Exception - */ - public static function renderStatic( - array $arguments, - \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext - ) { - trigger_error(__CLASS__ . ' will be removed in TYPO3 v12.', E_USER_DEPRECATED); - $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer(); - self::ensureProperNesting($viewHelperVariableContainer); - - /** @var ModuleTemplate $moduleTemplate */ - $moduleTemplate = $viewHelperVariableContainer->get(ModuleLayoutViewHelper::class, ModuleTemplate::class); - $menu = $moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu(); - $menu->setIdentifier($arguments['identifier']); - - $viewHelperVariableContainer->add(ModuleLayoutViewHelper::class, Menu::class, $menu); - $renderChildrenClosure(); - $moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu); - $viewHelperVariableContainer->remove(ModuleLayoutViewHelper::class, Menu::class); - } - - /** - * @param ViewHelperVariableContainer $viewHelperVariableContainer - * @throws Exception - */ - private static function ensureProperNesting(ViewHelperVariableContainer $viewHelperVariableContainer): void - { - if (!$viewHelperVariableContainer->exists(ModuleLayoutViewHelper::class, ModuleTemplate::class)) { - throw new Exception(sprintf('%s must be nested in <f.be.moduleLayout> ViewHelper', self::class), 1531235715); - } - if ($viewHelperVariableContainer->exists(ModuleLayoutViewHelper::class, Menu::class)) { - throw new Exception(sprintf('%s can not be nested in <f.be.moduleLayout.menu> ViewHelper', self::class), 1531235777); - } - } -} diff --git a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php b/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php deleted file mode 100644 index fcc35f936f4a..000000000000 --- a/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php +++ /dev/null @@ -1,107 +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\Backend\ViewHelpers; - -use TYPO3\CMS\Backend\Template\ModuleTemplate; -use TYPO3\CMS\Core\Messaging\FlashMessageService; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Service\ExtensionService; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; -use TYPO3Fluid\Fluid\View\Exception; - -/** - * A ViewHelper for having properly styled backend modules. - * It is recommended to use it in Fluid Layouts. - * It will render the required HTML for the doc header. - * All module specific output and further configuration of the doc header - * must be rendered as children of this ViewHelper. - * - * Examples - * ======== - * - * Default:: - * - * <be:moduleLayout> - * <f:render section="content" /> - * </be:moduleLayout> - * - * Output:: - * - * <!-- HTML of the backend module --> - * - * @deprecated since TYPO3 v11.3, will be removed in TYPO3 v12.0. - */ -class ModuleLayoutViewHelper extends AbstractViewHelper -{ - use CompileWithRenderStatic; - - /** - * @var bool - */ - protected $escapeOutput = false; - - /** - * Initialize arguments. - * - * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception - */ - public function initializeArguments() - { - parent::initializeArguments(); - $this->registerArgument('name', 'string', 'Name of the module, defaults to the current plugin name, if available', false); - $this->registerArgument('title', 'string', 'Title of the module.', false); - } - - public static function renderStatic( - array $arguments, - \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext - ) { - trigger_error(__CLASS__ . ' will be removed in TYPO3 v12.', E_USER_DEPRECATED); - $viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer(); - if ($viewHelperVariableContainer->exists(self::class, ModuleTemplate::class)) { - throw new Exception('ModuleLayoutViewHelper can only be used once per module.', 1483292643); - } - - $extensionService = GeneralUtility::makeInstance(ExtensionService::class); - $pluginNamespace = $extensionService->getPluginNamespace( - $renderingContext->getRequest()->getControllerExtensionName(), - $renderingContext->getRequest()->getPluginName() - ); - - $flashMessageQueue = GeneralUtility::makeInstance(FlashMessageService::class) - ->getMessageQueueByIdentifier('extbase.flashmessages.' . $pluginNamespace); - - $moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); - $moduleTemplate->setFlashMessageQueue($flashMessageQueue); - if (($arguments['name'] ?? null) !== null) { - $moduleTemplate->setModuleName($arguments['name']); - } - if (($arguments['title'] ?? null) !== null) { - $moduleTemplate->setTitle($arguments['title']); - } - - $viewHelperVariableContainer->add(self::class, ModuleTemplate::class, $moduleTemplate); - $moduleTemplate->setContent($renderChildrenClosure()); - $viewHelperVariableContainer->remove(self::class, ModuleTemplate::class); - - return $moduleTemplate->renderContent(); - } -} diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst index d65b75093aa4..0c8d35f07869 100644 --- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst @@ -44,7 +44,6 @@ The following PHP static class methods that have previously been marked as depre The following methods changed signature according to previous deprecations in v11 at the end of the argument list: - :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams` (argument 2 is removed) -- :php:`\Full\Class\Name->methodName` (argument 42 is now an integer) The following public class properties have been dropped: @@ -68,7 +67,11 @@ The following class properties visibility have been changed to private: The following ViewHelpers have been changed or removed: -- :html:`<f:helper.name>` Argument "foo" dropped +- :html:`<be:moduleLayout>` removed +- :html:`<be:moduleLayout.menu>` removed +- :html:`<be:moduleLayout.menuItem>` removed +- :html:`<be:moduleLayout.button.linkButton>` removed +- :html:`<be:moduleLayout.button.shortcutButton>` removed The following TypoScript options have been dropped or adapted: diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index e2f426bc9c26..cbbdc8138de2 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -1629,31 +1629,37 @@ return [ 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayoutViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\MenuViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\MenuItemViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\Button\AbstractButtonViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\Button\LinkButtonViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\Button\ShortcutButtonViewHelper' => [ 'restFiles' => [ 'Deprecation-94209-BackendModuleLayoutViewHelpers.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Extbase\Mvc\Exception\InvalidRequestMethodException' => [ -- GitLab