/** * @return array */ public function execute() { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Newsletter\Installer\Schema::MODULE_NAME); $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($this->newsletterRepository->countAll(1)); return ['newsletters' => $this->newsletterRepository->getAll(Newsletter\Helper\AccountStatus::ACCOUNT_STATUS_CONFIRMED, $this->pagination->getResultsStartOffset(), $resultsPerPage), 'pagination' => $this->pagination->render()]; }
/** * @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()]; }
/** * @return array */ public function execute() { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Users\Installer\Schema::MODULE_NAME); $allUsers = $this->userRepository->countAll(); $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($allUsers); $users = $this->userRepository->getAll($this->pagination->getResultsStartOffset(), $resultsPerPage); return ['users' => $users, 'pagination' => $this->pagination->render(), 'all_users' => $allUsers]; }
/** * @return array */ public function execute() { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Guestbook\Installer\Schema::MODULE_NAME); $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($this->guestbookRepository->countAll($this->guestbookSettings['notify'])); $guestbook = $this->guestbookRepository->getAll($this->guestbookSettings['notify'], $this->pagination->getResultsStartOffset(), $resultsPerPage); $cGuestbook = count($guestbook); for ($i = 0; $i < $cGuestbook; ++$i) { if ($this->guestbookSettings['emoticons'] == 1 && $this->emoticonsHelpers) { $guestbook[$i]['message'] = $this->emoticonsHelpers->emoticonsReplace($guestbook[$i]['message']); } } return ['guestbook' => $guestbook, 'overlay' => $this->guestbookSettings['overlay'], 'pagination' => $this->pagination->render(), 'dateformat' => $this->guestbookSettings['dateformat']]; }
/** * @param string $module * @param int $entryId * * @return array */ public function execute($module, $entryId) { $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']); $resultsPerPage = $this->resultsPerPage->getResultsPerPage(Comments\Installer\Schema::MODULE_NAME); $this->pagination->setResultsPerPage($resultsPerPage)->setTotalResults($this->commentRepository->countAllByModule($this->modules->getModuleId($module), $entryId)); $comments = $this->commentRepository->getAllByModule($this->modules->getModuleId($module), $entryId, $this->pagination->getResultsStartOffset(), $resultsPerPage); $cComments = count($comments); for ($i = 0; $i < $cComments; ++$i) { if (empty($comments[$i]['name'])) { $comments[$i]['name'] = $this->translator->t('users', 'deleted_user'); } if ($this->emoticonsActive === true && $this->emoticonsHelpers) { $comments[$i]['message'] = $this->emoticonsHelpers->emoticonsReplace($comments[$i]['message']); } } return ['comments' => $comments, 'dateformat' => $this->commentsSettings['dateformat'], 'pagination' => $this->pagination->render()]; }
/** * @param int $categoryId * @param string $time * * @return array */ private function fetchNews($categoryId, $time) { if (!empty($categoryId)) { $news = $this->newsRepository->getAllByCategoryId($categoryId, $time, $this->pagination->getResultsStartOffset(), $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME)); } else { $news = $this->newsRepository->getAll($time, $this->pagination->getResultsStartOffset(), $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME)); } return $news; }
/** * @inheritdoc */ protected function setMetaStatements() { parent::setMetaStatements(); // Vorherige und nächste Seite für Suchmaschinen und Prefetching propagieren if ($this->request->getArea() !== AreaEnum::AREA_ADMIN) { $path = ($this->request->getArea() === AreaEnum::AREA_ADMIN ? 'acp/' : '') . $this->request->getUriWithoutPages(); $link = $this->router->route($path); if ($this->currentPage - 1 > 0) { // Seitenangabe in der Seitenbeschreibung ab Seite 2 angeben $this->metaStatements->setDescriptionPostfix($this->translator->t('system', 'page_x', ['%page%' => $this->currentPage])); $this->metaStatements->setPreviousPage($link . 'page_' . ($this->currentPage - 1) . '/'); } if ($this->currentPage + 1 <= $this->totalPages) { $this->metaStatements->setNextPage($link . 'page_' . ($this->currentPage + 1) . '/'); } if ($this->request->getParameters()->get('page', 0) === 1) { $this->metaStatements->setCanonicalUri($link); } } }