‪TYPO3CMS  10.4
AbstractWidgetController.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
25 
32 {
36  protected ‪$supportedRequestTypes = [WidgetRequest::class];
37 
43  protected ‪$widgetConfiguration;
44 
52  {
53  $this->widgetConfiguration = ‪$request->getWidgetContext()->getWidgetConfiguration();
54  parent::processRequest(‪$request, ‪$response);
55  }
56 
64  {
65  $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
66  $widgetViewHelperClassName = $this->request->getWidgetContext()->getWidgetViewHelperClassName();
67  $templatePaths = new ‪TemplatePaths($this->controllerContext->getRequest()->getControllerExtensionKey());
68  $parentConfiguration = ‪$view->getTemplatePaths()->toArray();
69  $rootConfiguration = $templatePaths->toArray();
70  $pluginConfiguration = $extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName] ?? [];
71  if (isset($pluginConfiguration['templateRootPath']) && !isset($pluginConfiguration['templateRootPaths'])) {
72  $pluginConfiguration['templateRootPaths'][10] = $pluginConfiguration['templateRootPath'];
73  }
74  $widgetViewConfiguration = array_merge_recursive(
75  (array)$rootConfiguration,
76  (array)$parentConfiguration,
77  (array)$pluginConfiguration
78  );
79  ‪$view->getTemplatePaths()->fillFromConfigurationArray($widgetViewConfiguration);
80  }
81 }
‪TYPO3\CMS\Fluid\Core\Widget
Definition: AbstractWidgetController.php:16
‪TYPO3\CMS\Fluid\View\TemplatePaths
Definition: TemplatePaths.php:35
‪TYPO3\CMS\Extbase\Mvc\ResponseInterface
Definition: ResponseInterface.php:22
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$view
‪ViewInterface $view
Definition: ActionController.php:76
‪TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController\setViewConfiguration
‪setViewConfiguration(ViewInterface $view)
Definition: AbstractWidgetController.php:61
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:28
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK
‪const CONFIGURATION_TYPE_FRAMEWORK
Definition: ConfigurationManagerInterface.php:29
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$response
‪TYPO3 CMS Extbase Mvc Response $response
Definition: ActionController.php:115
‪TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController\$supportedRequestTypes
‪array $supportedRequestTypes
Definition: AbstractWidgetController.php:35
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:24
‪TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController\$widgetConfiguration
‪array $widgetConfiguration
Definition: AbstractWidgetController.php:41
‪TYPO3\CMS\Extbase\Mvc\RequestInterface
Definition: RequestInterface.php:22
‪TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController\processRequest
‪processRequest(RequestInterface $request, ResponseInterface $response)
Definition: AbstractWidgetController.php:49
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$request
‪TYPO3 CMS Extbase Mvc Request $request
Definition: ActionController.php:109
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
Definition: ActionController.php:55
‪TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController
Definition: AbstractWidgetController.php:32