1 | <?php |
||
41 | abstract class AbstractWidgetViewHelper extends AbstractCoreWidgetViewHelper implements ChildNodeAccessInterface |
||
42 | { |
||
43 | |||
44 | /** |
||
45 | * The Controller associated to this widget. |
||
46 | * This needs to be filled by the individual subclass by an @inject |
||
47 | * annotation. |
||
48 | * |
||
49 | * @var AbstractWidgetController |
||
50 | * @api |
||
51 | */ |
||
52 | protected $controller; |
||
53 | |||
54 | /** |
||
55 | * If set to TRUE, it is an AJAX widget. |
||
56 | * |
||
57 | * @var boolean |
||
58 | * @api |
||
59 | */ |
||
60 | protected $ajaxWidget = false; |
||
61 | |||
62 | /** |
||
63 | * @var AjaxWidgetContextHolder |
||
64 | */ |
||
65 | private $ajaxWidgetContextHolder; |
||
|
|||
66 | |||
67 | /** |
||
68 | * @var ObjectManagerInterface |
||
69 | */ |
||
70 | protected $objectManager; |
||
71 | |||
72 | /** |
||
73 | * @var \TYPO3\CMS\Extbase\Service\ExtensionService |
||
74 | * @inject |
||
75 | */ |
||
76 | protected $extensionService; |
||
77 | |||
78 | /** |
||
79 | * @var \TYPO3\CMS\Fluid\Core\Widget\WidgetContext |
||
80 | */ |
||
81 | private $widgetContext; |
||
82 | |||
83 | /** |
||
84 | * @param AjaxWidgetContextHolder $ajaxWidgetContextHolder |
||
85 | * @return void |
||
86 | 30 | */ |
|
87 | public function injectAjaxWidgetContextHolder(AjaxWidgetContextHolder $ajaxWidgetContextHolder) |
||
91 | |||
92 | /** |
||
93 | * @param ObjectManagerInterface $objectManager |
||
94 | * @return void |
||
95 | 30 | */ |
|
96 | public function injectObjectManager(ObjectManagerInterface $objectManager) |
||
101 | |||
102 | /** |
||
103 | * Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper. |
||
104 | * |
||
105 | * @return string the rendered ViewHelper. |
||
106 | 30 | */ |
|
107 | public function initializeArgumentsAndRender() |
||
114 | |||
115 | /** |
||
116 | * @todo The fallback on $this->controllerContext is only needed for TYPO3 8 backwards compatibility and can be dropped when TYPO3 8 is not supported anymore |
||
117 | * @return SolrControllerContext |
||
118 | * @throws \InvalidArgumentException |
||
119 | 30 | */ |
|
120 | protected function getControllerContext() |
||
135 | |||
136 | /** |
||
137 | * Initialize the Widget Context, before the Render method is called. |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | private function initializeWidgetContext() |
||
159 | 30 | ||
160 | /** |
||
161 | 30 | * Stores the syntax tree child nodes in the Widget Context, so they can be |
|
162 | * rendered with <f:widget.renderChildren> lateron. |
||
163 | * |
||
164 | * @param array $childNodes The SyntaxTree Child nodes of this ViewHelper. |
||
165 | * @return void |
||
166 | */ |
||
167 | public function setChildNodes(array $childNodes) |
||
175 | |||
176 | /** |
||
177 | * Generate the configuration for this widget. Override to adjust. |
||
178 | * |
||
179 | * @return array |
||
180 | 30 | * @api |
|
181 | 30 | */ |
|
182 | 30 | protected function getWidgetConfiguration() |
|
186 | |||
187 | /** |
||
188 | * Initiate a sub request to $this->controller. Make sure to fill $this->controller |
||
189 | * via Dependency Injection. |
||
190 | * |
||
191 | * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface the response of this request. |
||
192 | * @throws MissingControllerException |
||
193 | */ |
||
194 | 30 | protected function initiateSubRequest() |
|
211 | |||
212 | /** |
||
213 | * Pass the arguments of the widget to the subrequest. |
||
214 | 30 | * |
|
215 | * @param CoreWidgetRequest $subRequest |
||
216 | 30 | * @return void |
|
217 | 30 | */ |
|
218 | private function passArgumentsToSubRequest(CoreWidgetRequest $subRequest) |
||
230 | |||
231 | /** |
||
232 | * The widget identifier is unique on the current page, and is used |
||
233 | * in the URI as a namespace for the widget's arguments. |
||
234 | * |
||
235 | * @return string the widget identifier for this widget |
||
236 | * @return void |
||
237 | * @todo clean up, and make it somehow more routing compatible. |
||
238 | */ |
||
239 | private function initializeWidgetIdentifier() |
||
243 | } |
||
244 |