2 namespace TYPO3\CMS\Fluid\Core\Widget;
83 $this->widgetContext = $this->objectManager->get(\TYPO3\CMS\
Fluid\Core\Widget\WidgetContext::class);
108 $this->widgetContext->setControllerObjectName(get_class($this->controller));
109 $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
110 $pluginName = $this->controllerContext->getRequest()->getPluginName();
111 $this->widgetContext->setParentExtensionName($extensionName);
112 $this->widgetContext->setParentPluginName($pluginName);
113 $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
114 $this->widgetContext->setParentPluginNamespace($pluginNamespace);
115 $this->widgetContext->setWidgetViewHelperClassName(get_class($this));
116 if ($this->ajaxWidget ===
true) {
117 $this->ajaxWidgetContextHolder->store($this->widgetContext);
130 $rootNode = $this->objectManager->get(\TYPO3\CMS\
Fluid\Core\Parser\SyntaxTree\RootNode::class);
131 foreach ($childNodes as $childNode) {
132 $rootNode->addChildNode($childNode);
134 $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext);
158 if (isset($this->controller)) {
159 throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException(
'initiateSubRequest() can not be called if there is no valid controller extending TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController. Got "' . get_class($this->controller) .
'" in class "' . get_class($this) .
'".', 1289422564);
161 throw new \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException(
'initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) .
'".', 1284401632);
163 $subRequest = $this->objectManager->get(\TYPO3\CMS\
Fluid\Core\Widget\WidgetRequest::class);
164 $subRequest->setWidgetContext($this->widgetContext);
166 $subResponse = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
167 $this->controller->processRequest($subRequest, $subResponse);
179 $arguments = $this->controllerContext->getRequest()->getArguments();
180 $widgetIdentifier = $this->widgetContext->getWidgetIdentifier();
182 if (isset(
$arguments[$widgetIdentifier][
'action'])) {
183 $subRequest->setControllerActionName(
$arguments[$widgetIdentifier][
'action']);
184 unset(
$arguments[$widgetIdentifier][
'action']);
186 $subRequest->setArguments(
$arguments[$widgetIdentifier]);
200 if (!$this->viewHelperVariableContainer->exists(\TYPO3\CMS\
Fluid\Core\Widget\AbstractWidgetViewHelper::class,
'nextWidgetNumber')) {
203 $widgetCounter = $this->viewHelperVariableContainer->get(\TYPO3\CMS\
Fluid\Core\Widget\AbstractWidgetViewHelper::class,
'nextWidgetNumber');
205 $widgetIdentifier =
'@widget_' . $widgetCounter;
206 $this->viewHelperVariableContainer->addOrUpdate(\TYPO3\CMS\
Fluid\Core\Widget\AbstractWidgetViewHelper::class,
'nextWidgetNumber', $widgetCounter + 1);
207 $this->widgetContext->setWidgetIdentifier($widgetIdentifier);