TYPO3 CMS  TYPO3_8-7
WidgetRequestHandler.php
Go to the documentation of this file.
1 <?php
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 
24 {
29 
34 
38  protected $requestBuilder;
39 
44  {
45  $this->ajaxWidgetContextHolder = $ajaxWidgetContextHolder;
46  }
47 
51  public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
52  {
53  $this->configurationManager = $configurationManager;
54  }
55 
59  public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder)
60  {
61  // This method intentionally left blank
62  }
63 
67  public function injectWidgetRequestBuilder(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder)
68  {
69  $this->requestBuilder = $requestBuilder;
70  }
71 
77  public function handleRequest()
78  {
79  $request = $this->requestBuilder->build();
80  $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
81  $this->dispatcher->dispatch($request, $response);
82  return $response;
83  }
84 
88  public function canHandleRequest()
89  {
91  return isset($rawGetArguments['fluid-widget-id']);
92  }
93 
99  public function getPriority()
100  {
101  return 200;
102  }
103 }
injectAjaxWidgetContextHolder(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder)
injectWidgetRequestBuilder(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder)
injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder)