/**
  * Single view of a news record
  *
  * @param Tx_News_Domain_Model_News $news news item
  * @param integer $currentPage current page for optional pagination
  * @return void
  */
 public function detailAction(Tx_News_Domain_Model_News $news = NULL, $currentPage = 1)
 {
     if (is_null($news)) {
         $previewNewsId = (int) $this->settings['singleNews'] > 0 ? $this->settings['singleNews'] : 0;
         if ($this->request->hasArgument('news_preview')) {
             $previewNewsId = (int) $this->request->getArgument('news_preview');
         }
         if ($previewNewsId > 0) {
             if ($this->isPreviewOfHiddenRecordsEnabled()) {
                 $news = $this->newsRepository->findByUid($previewNewsId, FALSE);
             } else {
                 $news = $this->newsRepository->findByUid($previewNewsId);
             }
         }
     }
     if (is_null($news) && isset($this->settings['detail']['errorHandling'])) {
         $this->handleNoNewsFoundError($this->settings['detail']['errorHandling']);
     }
     $this->view->assignMultiple(array('newsItem' => $news, 'currentPage' => (int) $currentPage));
     Tx_News_Utility_Page::setRegisterProperties($this->settings['detail']['registerProperties'], $news);
 }
 /**
  * Single view of a news record
  *
  * @param Tx_News_Domain_Model_News $news news item
  * @param integer $currentPage current page for optional pagination
  * @return void
  */
 public function detailAction(Tx_News_Domain_Model_News $news = NULL, $currentPage = 1)
 {
     if (is_null($news)) {
         $previewNewsId = (int) $this->settings['singleNews'] > 0 ? $this->settings['singleNews'] : 0;
         if ($this->request->hasArgument('news_preview')) {
             $previewNewsId = (int) $this->request->getArgument('news_preview');
         }
         if ($previewNewsId > 0) {
             if ($this->isPreviewOfHiddenRecordsEnabled()) {
                 $news = $this->newsRepository->findByUid($previewNewsId, FALSE);
             } else {
                 $news = $this->newsRepository->findByUid($previewNewsId);
             }
         }
     }
     if (is_a($news, 'Tx_News_Domain_Model_News') && $this->settings['detail']['checkPidOfNewsRecord']) {
         $news = $this->checkPidOfNewsRecord($news);
     }
     if (is_null($news) && isset($this->settings['detail']['errorHandling'])) {
         $this->handleNoNewsFoundError($this->settings['detail']['errorHandling']);
     }
     $assignedValues = array('newsItem' => $news, 'currentPage' => (int) $currentPage);
     $this->emitActionSignal('NewsController', self::SIGNAL_NEWS_DETAIL_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
     Tx_News_Utility_Page::setRegisterProperties($this->settings['detail']['registerProperties'], $news);
     if (!is_null($news) && is_a($news, 'Tx_News_Domain_Model_News')) {
         Tx_News_Utility_Cache::addCacheTagsByNewsRecords(array($news));
     }
 }