/** * Shows a list of categories belonging to a parent folder * * @return void */ public function categoriesByFolderAction() { $folderId = $this->request->getHttpRequest()->getArgument('folderId'); $categories = $this->categoryService->getCategoriesByFolder($folderId); echo json_encode($categories); exit; }
/** * Shows a form for editing an existing news object * * @param \Lelesys\Plugin\News\Domain\Model\News $news The news to edit * @return void */ public function editAction(\Lelesys\Plugin\News\Domain\Model\News $news) { $this->view->assign('folders', $this->folderService->listAll()); $this->view->assign('relatedNews', $this->newsService->listRelatedNews($news)); $this->view->assign('newsCategories', $this->categoryService->getEnabledLatestCategories()); $this->view->assign('newsTags', $news->getTags()); $this->view->assign('news', $news); $this->view->assign('media', $news->getAssets()); $this->view->assign('files', $news->getFiles()); $this->view->assign('relatedLinks', $news->getRelatedLinks()); }
/** * Returns the processed Configuration * * @param \TYPO3\TYPO3CR\Domain\Model\NodeType $nodeType (uninitialized) The node type to process * @param array $configuration input configuration * @param array $options The processor options * @return void */ public function process(NodeType $nodeType, array &$configuration, array $options) { $folders = $this->folderService->listAll(); if ($folders->count()) { foreach ($folders as $folder) { /** @var $folder \Lelesys\Plugin\News\Domain\Model\Folder */ $configuration['properties']['folderId']['ui']['inspector']['editorOptions']['values'][$folder->getUuid()] = array('label' => $folder->getTitle()); } } $categories = $this->categoryService->getEnabledLatestCategories(); if ($categories->count()) { foreach ($categories as $category) { /** @var $category \Lelesys\Plugin\News\Domain\Model\Category */ $configuration['properties']['categoryId']['ui']['inspector']['editorOptions']['values'][$category->getUuid()] = array('label' => $category->getTitle()); } } $parentCategories = $this->categoryService->getEnabledParentCategories(); if ($parentCategories->count()) { foreach ($parentCategories as $category) { /** @var $category \Lelesys\Plugin\News\Domain\Model\Category */ $configuration['properties']['parentCategoryId']['ui']['inspector']['editorOptions']['values'][$category->getUuid()] = array('label' => $category->getTitle()); } } }
/** * checks the title * * @param string $categoryTitle * @return void */ public function checkTitleAction($categoryTitle) { $title = $this->categoryService->checkTitle($categoryTitle); echo count($title); exit; }