/** * Create a new list item * * @param string $label * @param ToDoList $list * @return void */ public function addAction($label, ToDoList $list) { $item = new Item(); $item->setLabel($label); $item->setList($list); $typoScriptView = new TypoScriptView(); $typoScriptView->setControllerContext($this->controllerContext); $typoScriptView->setTypoScriptPath(self::TS_PATH_ITEM); $typoScriptView->assign('item', $item); $this->itemRepository->add($item); $this->view->assign('value', array('type' => 'success:add', 'entity' => get_class($item), 'view' => $typoScriptView->render())); }
/** * Initialize the TypoScript View * * @return void */ protected function initializeTypoScriptView() { $this->typoScriptView = new TypoScriptView(); $this->typoScriptView->setControllerContext($this->controllerContext); $this->typoScriptView->disableFallbackView(); if ($this->hasArgument('typoScriptFilePathPattern')) { $this->typoScriptView->setTypoScriptPathPattern($this->arguments['typoScriptFilePathPattern']); } }
/** * Helper to build a TypoScript view object * * @return TypoScriptView */ protected function buildView() { $view = new TypoScriptView(); $httpRequest = Request::createFromEnvironment(); $request = $httpRequest->createActionRequest(); $uriBuilder = new UriBuilder(); $uriBuilder->setRequest($request); $this->controllerContext = new ControllerContext($request, new Response(), new Arguments(array()), $uriBuilder); $view->setControllerContext($this->controllerContext); $view->disableFallbackView(); $view->setPackageKey('TYPO3.TypoScript'); $view->setTypoScriptPathPattern(__DIR__ . '/Fixtures/TypoScript'); $view->assign('fixtureDirectory', __DIR__ . '/Fixtures/'); return $view; }
/** * Displays the backend interface * * @param NodeInterface $node The node that will be displayed on the first tab * @return void */ public function indexAction(NodeInterface $node = null) { $this->contentCache->flush(); $this->session->start(); $this->session->putData('__cheEnabled__', true); if ($user = $this->userService->getBackendUser()) { $workspaceName = $this->userService->getPersonalWorkspaceName(); $contentContext = $this->createContext($workspaceName); $contentContext->getWorkspace(); $this->persistenceManager->persistAll(); $siteNode = $contentContext->getCurrentSiteNode(); if ($node === null) { $node = $siteNode; } $this->view->assign('user', $user); $this->view->assign('documentNode', $node); $this->view->assign('site', $node); $this->view->assign('translations', $this->xliffService->getCachedJson(new Locale($this->userService->getInterfaceLanguage()))); return; } $this->redirectToUri($this->uriBuilder->uriFor('index', array(), 'Login', 'TYPO3.Neos')); }
/** * Prepare a TypoScriptView for testing that Mocks a request with the given controller and action names. * * @param string $controllerObjectName * @param string $controllerActionName * @return TypoScriptView */ protected function buildView($controllerObjectName, $controllerActionName) { $request = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\ActionRequest')->disableOriginalConstructor()->getMock(); $request->expects($this->any())->method('getControllerObjectName')->will($this->returnValue($controllerObjectName)); $request->expects($this->any())->method('getControllerActionName')->will($this->returnValue($controllerActionName)); $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $view = new TypoScriptView(); $view->setControllerContext($this->mockControllerContext); $this->inject($view, 'fallbackView', $this->mockFallbackView); $view->setTypoScriptPathPattern(__DIR__ . '/Fixtures/TypoScript'); return $view; }
public function __construct(array $options = array()) { parent::__construct($options); $this->setTypoScriptPathPattern('resource://PackageFactory.Guevara/Private/TypoScript/Backend'); }
public function __construct(array $options = array()) { parent::__construct($options); $this->setTypoScriptPathPattern('resource://Neos.Neos.Ui/Private/TypoScript/Backend'); }
/** * @return void */ public function indexAction() { $toDoList = $this->toDoListRepository->findActive(); $this->view->assign('list', $toDoList); }