/** * Shows a list of news * * @param string $category The category * @param string $folder The folder * @param string $tag The tag * @param integer $year News year * @param string $month News month * @return void */ public function indexAction($category = NULL, $folder = NULL, $tag = NULL, $year = NULL, $month = NULL) { $currentNode = $this->request->getInternalArgument('__node'); $pluginArguments = $currentNode->getProperties(); if (isset($pluginArguments['itemsPerPage'])) { $itemsPerPage = (int) $pluginArguments['itemsPerPage']; } else { $itemsPerPage = ''; } if ($month !== NULL) { $allNews = $this->newsService->archiveNewsList($category, $folder, $year, $month, $pluginArguments); } else { if ($this->request->hasArgument('newsBySelection')) { $nodeArgument = $this->request->getArgument('newsBySelection'); $currentNode->setProperty('categoryId', $nodeArgument['category']); $currentNode->setProperty('folderId', $nodeArgument['folder']); } if ($category === NULL && $folder === NULL) { $categoryId = $currentNode->getProperty('categoryId'); $folderId = $currentNode->getProperty('folderId'); $this->view->assign('folderId', $folderId); $this->view->assign('categoryId', $categoryId); if ($categoryId !== NULL) { $category = $categoryId; } if ($folderId !== NULL) { $folder = $folderId; } } $allNews = $this->newsService->listAllBySelection($category, $folder, $pluginArguments, $tag); } $this->view->assign('allNews', $allNews); $this->view->assign('assetsForNews', $this->newsService->assetsForNews($allNews)); // To show the list of news category $this->view->assign('newsComments', $this->commentService->getEnabledComments($allNews)); $this->view->assign('itemsPerPage', $itemsPerPage); $this->view->assign('categories', $this->categoryService->getEnabledLatestCategories()); $this->view->assign('folders', $this->folderService->listAll()); $this->view->assign('baseUri', $this->bootstrap->getActiveRequestHandler()->getHttpRequest()->getBaseUri()); }