/** * @param array $module * @return void * @FLOW3\SkipCsrfProtection */ public function indexAction(array $module) { $moduleRequest = new ActionRequest($this->request); $moduleRequest->setArgumentNamespace('moduleArguments'); $moduleRequest->setControllerObjectName($module['controller']); $moduleRequest->setControllerActionName($module['action']); if ($this->request->hasArgument($moduleRequest->getArgumentNamespace()) === TRUE && is_array($this->request->getArgument($moduleRequest->getArgumentNamespace()))) { $moduleRequest->setArguments($this->request->getArgument($moduleRequest->getArgumentNamespace())); } foreach ($this->request->getPluginArguments() as $argumentNamespace => $argument) { $moduleRequest->setArgument('--' . $argumentNamespace, $argument); } $modules = explode('/', $module['module']); $moduleConfiguration = \TYPO3\FLOW3\Utility\Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $modules)); $moduleConfiguration['path'] = $module['module']; $moduleBreadcrumb = array(); $path = array(); foreach ($modules as $moduleIdentifier) { array_push($path, $moduleIdentifier); $config = \TYPO3\FLOW3\Utility\Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $path)); $moduleBreadcrumb[implode('/', $path)] = $config['label']; } $moduleRequest->setArgument('__moduleConfiguration', $moduleConfiguration); $moduleRequest->setArgument('__moduleBreadcrumb', $moduleBreadcrumb); $moduleResponse = new Response($this->response); $this->dispatcher->dispatch($moduleRequest, $moduleResponse); $this->view->assignMultiple(array('moduleClass' => implode('-', $modules), 'moduleContents' => $moduleResponse->getContent(), 'title' => $moduleRequest->hasArgument('title') ? $moduleRequest->getArgument('title') : $moduleConfiguration['label'], 'rootModule' => array_shift($modules), 'submodule' => array_shift($modules), 'moduleConfiguration' => $moduleConfiguration)); }
/** * @test */ public function argumentNamespaceCanBeSpecified() { $httpRequest = HttpRequest::create(new Uri('http://localhost')); $actionRequest = new ActionRequest($httpRequest); $this->assertSame('', $actionRequest->getArgumentNamespace()); $actionRequest->setArgumentNamespace('someArgumentNamespace'); $this->assertSame('someArgumentNamespace', $actionRequest->getArgumentNamespace()); }