예제 #1
0
파일: Index.php 프로젝트: acp3/cms
 /**
  * @return array
  */
 public function execute()
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Gallery\Installer\Schema::MODULE_NAME);
     $time = $this->date->getCurrentDateTime();
     $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($this->galleryRepository->countAll($time));
     return ['galleries' => $this->galleryRepository->getAll($time, $this->pagination->getResultsStartOffset(), $resultsPerPage), 'dateformat' => $this->settings['dateformat'], 'pagination' => $this->pagination->render()];
 }
예제 #2
0
 protected function fetchSitemapUrls()
 {
     $this->addUrl('gallery/index/index');
     foreach ($this->galleryRepository->getAll($this->date->getCurrentDateTime()) as $result) {
         $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN_GALLERY, $result['id']), $this->date->format($result['updated_at'], 'Y-m-d'));
         foreach ($this->pictureRepository->getPicturesByGalleryId($result['id']) as $picture) {
             $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN_PICTURE, $picture['id']), $this->date->format($result['updated_at'], 'Y-m-d'));
         }
     }
 }
예제 #3
0
파일: Index.php 프로젝트: acp3/cms
 /**
  * @return array
  */
 public function execute()
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     $settings = $this->config->getSettings(Gallery\Installer\Schema::MODULE_NAME);
     return ['sidebar_galleries' => $this->galleryModel->getAll($this->date->getCurrentDateTime(), $settings['sidebar'])];
 }