/**
  * Performs archive search
  *
  * @param string $month Month, numeric 1-12
  * @param int $year Year, numeric yyyy
  *
  * @ignorevalidation $month
  * @ignorevalidation $year
  *
  * @return void
  */
 public function showAction($month, $year)
 {
     $this->search->setDateRange(DateRange::fromMonthAndYear($month, $year));
     $this->search->setPageType(Type::fromString($this->settings['pageType']));
     $pages = $this->pageRepository->findArchived($this->search);
     $this->view->assign('pages', $pages);
     $this->view->assign('search', $this->search);
 }
 /**
  * Lists last updated pages
  *
  * @return void
  */
 public function listAction()
 {
     $pageType = Type::fromString($this->settings['pageType']);
     $offset = (int) $this->settings['offset'];
     $limit = (int) $this->settings['limit'];
     $pages = $this->pageRepository->findLastUpdated($pageType, $offset - 1, $limit);
     $this->view->assign('pages', $pages);
 }
示例#3
0
 /**
  * Returns the available/allowed doktypes
  *
  * @return array
  */
 public function getPageTypes()
 {
     $pageTypes = isset($this->settings['doktypes']) ? $this->settings['doktypes'] : [1];
     foreach ($pageTypes as $pageType) {
         $this->pageTypes->add(Type::fromString($pageType));
     }
     return $this->pageTypes;
 }
示例#4
0
 /**
  * Archive listing
  *
  * @return void
  */
 public function showAction()
 {
     $dates = $this->dateRepository->findByPageType(Type::fromString($this->settings['pageType']));
     $this->view->assign('dates', $dates);
 }
 /**
  * Renders the content preview of a content element.
  *
  * The initial item content is passed as a reference like in the core's
  * PageLayoutViewDrawItemHookInterface. The implementation has to modify
  * the content.
  *
  * @param PageLayoutView $parentObject Calling parent object
  * @param string $itemContent Item content
  * @param array $row Record row of tt_content
  *
  * @return void
  */
 public function renderContent(PageLayoutView &$parentObject, &$itemContent, array &$row)
 {
     $this->view->assign('section', 'itemContent');
     $pageType = Type::fromString($this->getFlexformValue($row['pi_flexform'], 'settings.pageType'));
     $offset = (int) $this->getFlexformValue($row['pi_flexform'], 'settings.offset');
     $limit = (int) $this->getFlexformValue($row['pi_flexform'], 'settings.limit');
     $this->view->assign('typeLabelReference', $this->getPageTypeLabelReference($pageType));
     $this->view->assign('offset', $offset);
     $this->view->assign('limit', $limit);
     $pages = $this->pageRepository->findLastUpdated($pageType, $offset - 1, $limit);
     $this->view->assign('pages', $pages);
     $itemContent .= $this->view->render();
 }