/** * 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())); }
/** * 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')); }
/** * @return void */ public function indexAction() { $toDoList = $this->toDoListRepository->findActive(); $this->view->assign('list', $toDoList); }