Example #1
0
File: Index.php Project: 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()];
 }
Example #2
0
File: Pics.php Project: acp3/cms
 /**
  * @param int $id
  *
  * @return array
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     if ($this->galleryRepository->galleryExists($id, $this->date->getCurrentDateTime()) === true) {
         $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
         $this->breadcrumb->append($this->translator->t('gallery', 'gallery'), 'gallery')->append($this->galleryRepository->getGalleryTitle($id));
         return ['pictures' => $this->galleryCache->getCache($id), 'overlay' => (int) $this->settings['overlay']];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }
 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'));
         }
     }
 }
Example #4
0
File: Create.php Project: acp3/cms
 /**
  * @param int $id
  *
  * @return array|\Symfony\Component\HttpFoundation\RedirectResponse
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     if ($this->galleryRepository->galleryExists($id) === true) {
         $gallery = $this->galleryRepository->getGalleryTitle($id);
         $this->breadcrumb->append($gallery, 'acp/gallery/index/edit/id_' . $id)->append($this->translator->t('gallery', 'admin_pictures_create'));
         $settings = $this->config->getSettings(Gallery\Installer\Schema::MODULE_NAME);
         if ($this->request->getPost()->count() !== 0) {
             return $this->executePost($this->request->getPost()->all(), $settings, $id);
         }
         if ($settings['overlay'] == 0 && $settings['comments'] == 1 && $this->modules->isActive('comments') === true) {
             $this->view->assign('options', $this->getOptions('0'));
         }
         return ['form' => array_merge(['description' => ''], $this->request->getPost()->all()), 'gallery_id' => $id, 'form_token' => $this->formTokenHelper->renderFormToken()];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }
Example #5
0
File: Index.php Project: 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'])];
 }