Example #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()];
 }
Example #2
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 #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];
 }
Example #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']];
 }
Example #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()];
 }
Example #6
0
 /**
  * @param int $cat
  *
  * @return array
  */
 public function execute($cat = 0)
 {
     $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
     $this->addBreadcrumbStep($cat);
     $time = $this->date->getCurrentDateTime();
     $this->pagination->setResultsPerPage($this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME))->setTotalResults($this->newsRepository->countAll($time, $cat));
     $news = $this->fetchNews($cat, $time);
     $cNews = count($news);
     for ($i = 0; $i < $cNews; ++$i) {
         $news[$i]['text'] = $this->view->fetchStringAsTemplate($news[$i]['text']);
         if ($this->commentsActive === true && $news[$i]['comments'] == 1) {
             $news[$i]['comments_count'] = $this->get('comments.helpers')->commentsCount(News\Installer\Schema::MODULE_NAME, $news[$i]['id']);
         }
         if ($this->newsSettings['readmore'] == 1 && $news[$i]['readmore'] == 1) {
             $news[$i]['text'] = $this->addReadMoreLink($news[$i]);
         }
     }
     return ['news' => $news, 'dateformat' => $this->newsSettings['dateformat'], 'categories' => $this->categoriesHelpers->categoriesList('news', $cat), 'pagination' => $this->pagination->render()];
 }