TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractWidgetController.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\Core\Widget;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
27 {
31  protected $supportedRequestTypes = [\TYPO3\CMS\Fluid\Core\Widget\WidgetRequest::class];
32 
40 
49  public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
50  {
51  $this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
52  parent::processRequest($request, $response);
53  }
54 
62  protected function setViewConfiguration(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
63  {
64  $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
65  $widgetViewHelperClassName = $this->request->getWidgetContext()->getWidgetViewHelperClassName();
66  $templatePaths = new TemplatePaths($this->controllerContext->getRequest()->getControllerExtensionKey());
67  $widgetViewConfiguration = null;
68  $parentConfiguration = $view->getTemplatePaths()->toArray();
69  $rootConfiguration = $templatePaths->toArray();
70  if (!isset($extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName])) {
71  $widgetViewConfiguration = array_merge_recursive($parentConfiguration, $rootConfiguration);
72  } else {
73  $widgetViewConfiguration = array_merge_recursive(
74  (array) $rootConfiguration,
75  (array) $parentConfiguration,
76  (array) $extbaseFrameworkConfiguration['view']['widget'][$widgetViewHelperClassName]
77  );
78  }
79  $view->getTemplatePaths()->fillFromConfigurationArray($widgetViewConfiguration);
80  }
81 }
processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request,\TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
setViewConfiguration(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)