Beispiel #1
0
 /**
  * @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()];
 }
Beispiel #2
0
 /**
  * @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()];
 }
Beispiel #3
0
 /**
  * @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];
 }
Beispiel #4
0
 /**
  * @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']];
 }
Beispiel #5
0
 /**
  * @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()];
 }
Beispiel #6
0
 /**
  * @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;
 }