コード例 #1
0
 /**
  * Shows a list of latest news
  *
  * @return void
  */
 public function latestNewsAction()
 {
     $currentNode = $this->request->getInternalArgument('__node');
     $pluginArguments = $currentNode->getProperties();
     if ($this->request->hasArgument('newsBySelection')) {
         $nodeArgument = $this->request->getArgument('newsBySelection');
         $currentNode->setProperty('categoryId', $nodeArgument['category']);
         $currentNode->setProperty('folderId', $nodeArgument['folder']);
     }
     $categoryId = $currentNode->getProperty('categoryId');
     $folderId = $currentNode->getProperty('folderId');
     $this->view->assign('folderId', $folderId);
     $this->view->assign('categoryId', $categoryId);
     $category = NULL;
     $folder = NULL;
     if ($categoryId !== NULL) {
         $category = $categoryId;
     }
     if ($folderId !== NULL) {
         $folder = $folderId;
     }
     $allNews = $this->newsService->listAllBySelection($category, $folder, $pluginArguments);
     $this->view->assign('newsLatestComments', $this->commentService->getEnabledComments($allNews));
     $this->view->assign('categories', $this->categoryService->getEnabledLatestCategories());
     $this->view->assign('folders', $this->folderService->listAll());
     $this->view->assign('allNews', $allNews);
     $this->view->assign('assetsForNews', $this->newsService->assetsForNews($allNews));
     $this->view->assign('baseUri', $this->bootstrap->getActiveRequestHandler()->getHttpRequest()->getBaseUri());
 }