Ejemplo n.º 1
0
 /**
  * Render a menu by dates, e.g. years, months or dates
  *
  * @param array $overwriteDemand
  * @return void
  */
 public function dateMenuAction(array $overwriteDemand = NULL)
 {
     $demand = $this->createDemandObjectFromSettings($this->settings);
     // It might be that those are set, @see http://forge.typo3.org/issues/44759
     $demand->setLimit(0);
     $demand->setOffset(0);
     // @todo: find a better way to do this related to #13856
     if (!($dateField = $this->settings['dateField'])) {
         $dateField = 'datetime';
     }
     $demand->setOrder($dateField . ' ' . $this->settings['orderDirection']);
     $newsRecords = $this->newsRepository->findDemanded($demand);
     $demand->setOrder($this->settings['orderDirection']);
     $statistics = $this->newsRepository->countByDate($demand);
     $assignedValues = array('listPid' => $this->settings['listPid'] ? $this->settings['listPid'] : $GLOBALS['TSFE']->id, 'dateField' => $dateField, 'data' => $statistics, 'news' => $newsRecords, 'overwriteDemand' => $overwriteDemand, 'demand' => $demand);
     $this->emitActionSignal('NewsController', self::SIGNAL_NEWS_DATEMENU_ACTION, $assignedValues);
     $this->view->assignMultiple($assignedValues);
 }