/** * @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(); }
/** * @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(); }