/** * @return string * @route off */ public function renderAction() { $row = $this->getRecord(); $extensionKey = $this->provider->getExtensionKey($row); $pluginSignature = 'tx_' . str_replace('_', '', $extensionKey) . '_' . str_replace('_', '', strtolower($this->request->getPluginName())); $controllerExtensionKey = $this->provider->getControllerExtensionKeyFromRecord($row); $requestParameterActionName = ResolveUtility::resolveOverriddenFluxControllerActionNameFromRequestParameters($pluginSignature); $controllerActionName = $this->provider->getControllerActionFromRecord($row); $overriddenControllerActionName = NULL !== $requestParameterActionName ? $requestParameterActionName : $controllerActionName; $controllerName = $this->request->getControllerName(); return $this->performSubRendering($controllerExtensionKey, $controllerName, $overriddenControllerActionName, $pluginSignature); }
/** * @param string $extensionName * @param string $controllerClassName * @param string $controllerActionName * @param string $pluginSignature * @return string */ protected function callSubControllerAction($extensionName, $controllerClassName, $controllerActionName, $pluginSignature) { /** @var Response $response */ $post = GeneralUtility::_POST($pluginSignature); $row = $this->getRecord(); $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response'); $arguments = (array) (TRUE === is_array($post) ? $post : GeneralUtility::_GET($pluginSignature)); $potentialControllerInstance = $this->objectManager->get($controllerClassName); $viewContext = $this->provider->getViewContext($row, $this->request); $viewContext->setPackageName($this->provider->getControllerPackageNameFromRecord($row)); $subRequest = $viewContext->getRequest(); $subRequest->setControllerExtensionName($viewContext->getExtensionName()); $subRequest->setControllerVendorName($viewContext->getVendorName()); $subRequest->setControllerActionName($this->provider->getControllerActionFromRecord($row)); $potentialControllerInstance->processRequest($subRequest, $response); return $response->getContent(); }
/** * @param ProviderInterface $provider * @param array $row * @param Form $form * @return string */ protected function renderGrid(ProviderInterface $provider, array $row, Form $form) { $grid = $provider->getGrid($row); $content = ''; if (TRUE === $grid->hasChildren()) { $workspaceVersionOfRow = $this->workspacesAwareRecordService->getSingle('tt_content', '*', $row['uid']); $content = $this->drawGrid($workspaceVersionOfRow, $grid, $form); $options = $this->getPreviewOptions($form); if (TRUE === $this->getOptionToggle($options)) { $content = $this->drawGridToggle($workspaceVersionOfRow, $content); } } return $content; }
/** * @param ProviderInterface $provider * @param array $row * @param Form $form * @return string */ protected function renderGrid(ProviderInterface $provider, array $row, Form $form) { $grid = $provider->getGrid($row); $content = ''; if (TRUE === $grid->hasChildren()) { $workspaceVersionOfRow = $this->workspacesAwareRecordService->getSingle('tt_content', '*', $row['uid']); if ((int) $workspaceVersionOfRow['pid'] === -1 && !empty($workspaceVersionOfRow['t3ver_oid'])) { $originalRecord = BackendUtility::getRecord('tt_content', $workspaceVersionOfRow['t3ver_oid'], '*', '', FALSE); $workspaceVersionOfRow['pid'] = $originalRecord['pid']; } $content = $this->drawGrid($workspaceVersionOfRow, $grid, $form); $options = $this->getPreviewOptions($form); if (TRUE === $this->getOptionToggle($options)) { $content = $this->drawGridToggle($workspaceVersionOfRow, $content); } } return $content; }