Commit 41a1540d authored by Tino Goratsch's avatar Tino Goratsch

refs #8

- replaced all usages of UserModel::getEntriesPerPage() with ResultsPerPage::getResultsPerPage()
parent 060a9f29
...@@ -69,6 +69,10 @@ abstract class AbstractWidgetAction implements ActionInterface ...@@ -69,6 +69,10 @@ abstract class AbstractWidgetAction implements ActionInterface
* @var Response * @var Response
*/ */
protected $response; protected $response;
/**
* @var Core\Helpers\ResultsPerPage
*/
protected $resultsPerPage;
/** /**
* WidgetController constructor. * WidgetController constructor.
...@@ -90,6 +94,7 @@ abstract class AbstractWidgetAction implements ActionInterface ...@@ -90,6 +94,7 @@ abstract class AbstractWidgetAction implements ActionInterface
$this->config = $context->getConfig(); $this->config = $context->getConfig();
$this->appPath = $context->getAppPath(); $this->appPath = $context->getAppPath();
$this->response = $context->getResponse(); $this->response = $context->getResponse();
$this->resultsPerPage = $context->getResultsPerPage();
} }
/** /**
......
...@@ -58,7 +58,8 @@ class FrontendContext extends Core\Controller\Context\WidgetContext ...@@ -58,7 +58,8 @@ class FrontendContext extends Core\Controller\Context\WidgetContext
$context->getView(), $context->getView(),
$context->getConfig(), $context->getConfig(),
$context->getAppPath(), $context->getAppPath(),
$context->getResponse() $context->getResponse(),
$context->getResultsPerPage()
); );
$this->assets = $assets; $this->assets = $assets;
......
...@@ -7,6 +7,7 @@ namespace ACP3\Core\Controller\Context; ...@@ -7,6 +7,7 @@ namespace ACP3\Core\Controller\Context;
use ACP3\Core\ACL; use ACP3\Core\ACL;
use ACP3\Core\Environment\ApplicationPath; use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\Helpers\ResultsPerPage;
use ACP3\Core\Http\RequestInterface; use ACP3\Core\Http\RequestInterface;
use ACP3\Core\I18n\Translator; use ACP3\Core\I18n\Translator;
use ACP3\Core\Modules; use ACP3\Core\Modules;
...@@ -77,6 +78,10 @@ class WidgetContext ...@@ -77,6 +78,10 @@ class WidgetContext
* @var \Symfony\Component\HttpFoundation\Response * @var \Symfony\Component\HttpFoundation\Response
*/ */
private $response; private $response;
/**
* @var ResultsPerPage
*/
private $resultsPerPage;
/** /**
* WidgetContext constructor. * WidgetContext constructor.
...@@ -94,6 +99,7 @@ class WidgetContext ...@@ -94,6 +99,7 @@ class WidgetContext
* @param \ACP3\Core\Settings\SettingsInterface $config * @param \ACP3\Core\Settings\SettingsInterface $config
* @param \ACP3\Core\Environment\ApplicationPath $appPath * @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param Response $response * @param Response $response
* @param ResultsPerPage $resultsPerPage
*/ */
public function __construct( public function __construct(
ContainerInterface $container, ContainerInterface $container,
...@@ -108,7 +114,8 @@ class WidgetContext ...@@ -108,7 +114,8 @@ class WidgetContext
View $view, View $view,
SettingsInterface $config, SettingsInterface $config,
ApplicationPath $appPath, ApplicationPath $appPath,
Response $response Response $response,
ResultsPerPage $resultsPerPage
) { ) {
$this->container = $container; $this->container = $container;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
...@@ -123,6 +130,7 @@ class WidgetContext ...@@ -123,6 +130,7 @@ class WidgetContext
$this->config = $config; $this->config = $config;
$this->appPath = $appPath; $this->appPath = $appPath;
$this->response = $response; $this->response = $response;
$this->resultsPerPage = $resultsPerPage;
} }
/** /**
...@@ -228,4 +236,12 @@ class WidgetContext ...@@ -228,4 +236,12 @@ class WidgetContext
{ {
return $this->response; return $this->response;
} }
/**
* @return ResultsPerPage
*/
public function getResultsPerPage()
{
return $this->resultsPerPage;
}
} }
...@@ -4,13 +4,6 @@ ...@@ -4,13 +4,6 @@
* See the LICENCE file at the top-level module directory for licencing details. * See the LICENCE file at the top-level module directory for licencing details.
*/ */
/**
* Created by PhpStorm.
* User: tinog
* Date: 07.11.2016
* Time: 01:28
*/
namespace ACP3\Core\Helpers; namespace ACP3\Core\Helpers;
...@@ -44,28 +37,17 @@ class ResultsPerPage ...@@ -44,28 +37,17 @@ class ResultsPerPage
public function getResultsPerPage($moduleName) public function getResultsPerPage($moduleName)
{ {
if (!isset($this->resultsPerPage[$moduleName])) { if (!isset($this->resultsPerPage[$moduleName])) {
$moduleName = $this->addResultsToCache($moduleName); $moduleSettings = $this->settings->getSettings($moduleName);
}
return (int)$this->resultsPerPage[$moduleName]; if (!empty($moduleSettings['entries'])) {
} $this->resultsPerPage[$moduleName] = $moduleSettings['entries'];
} else {
$moduleName = Schema::MODULE_NAME;
/** $this->getResultsPerPage($moduleName);
* @param string $moduleName }
* @return string
*/
protected function addResultsToCache($moduleName)
{
$moduleSettings = $this->settings->getSettings($moduleName);
if (!empty($moduleName['entries'])) {
$this->resultsPerPage[$moduleName] = $moduleSettings['entries'];
} else {
$moduleName = Schema::MODULE_NAME;
$this->getResultsPerPage($moduleName);
} }
return $moduleName; return (int)$this->resultsPerPage[$moduleName];
} }
} }
...@@ -6,7 +6,6 @@ use ACP3\Core\Controller\AreaEnum; ...@@ -6,7 +6,6 @@ use ACP3\Core\Controller\AreaEnum;
use ACP3\Core\Http\RequestInterface; use ACP3\Core\Http\RequestInterface;
use ACP3\Core\I18n\Translator; use ACP3\Core\I18n\Translator;
use ACP3\Core\Router\RouterInterface; use ACP3\Core\Router\RouterInterface;
use ACP3\Modules\ACP3\Users\Model\UserModel;
/** /**
* Class Pagination * Class Pagination
...@@ -69,15 +68,12 @@ class Pagination ...@@ -69,15 +68,12 @@ class Pagination
/** /**
* Pagination constructor. * Pagination constructor.
* * @param Title $title
* @param \ACP3\Modules\ACP3\Users\Model\UserModel $user * @param Translator $translator
* @param \ACP3\Core\Breadcrumb\Title $title * @param RequestInterface $request
* @param \ACP3\Core\I18n\Translator $translator * @param RouterInterface $router
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Router\RouterInterface $router
*/ */
public function __construct( public function __construct(
UserModel $user,
Title $title, Title $title,
Translator $translator, Translator $translator,
RequestInterface $request, RequestInterface $request,
...@@ -87,8 +83,6 @@ class Pagination ...@@ -87,8 +83,6 @@ class Pagination
$this->translator = $translator; $this->translator = $translator;
$this->request = $request; $this->request = $request;
$this->router = $router; $this->router = $router;
$this->resultsPerPage = $user->getEntriesPerPage();
} }
/** /**
......
...@@ -15,6 +15,7 @@ services: ...@@ -15,6 +15,7 @@ services:
- '@core.config' - '@core.config'
- '@core.environment.application_path' - '@core.environment.application_path'
- '@core.http.response' - '@core.http.response'
- '@core.helpers.results_per_page'
public: false public: false
core.context.admin: core.context.admin:
......
...@@ -77,7 +77,6 @@ services: ...@@ -77,7 +77,6 @@ services:
core.pagination: core.pagination:
class: ACP3\Core\Pagination class: ACP3\Core\Pagination
arguments: arguments:
- '@users.model.user_model'
- '@core.breadcrumb.title' - '@core.breadcrumb.title'
- '@core.lang' - '@core.lang'
- '@core.http.request' - '@core.http.request'
......
...@@ -8,7 +8,7 @@ namespace ACP3\Modules\ACP3\Articles\Controller\Admin\Index; ...@@ -8,7 +8,7 @@ namespace ACP3\Modules\ACP3\Articles\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Articles; use ACP3\Modules\ACP3\Articles;
use ACP3\Modules\ACP3\Menus; use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -45,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -45,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/articles/index/delete') ->setResourcePathDelete('admin/articles/index/delete')
->setResourcePathEdit('admin/articles/index/edit'); ->setResourcePathEdit('admin/articles/index/edit');
......
...@@ -63,7 +63,7 @@ class Index extends Core\Controller\AbstractFrontendAction ...@@ -63,7 +63,7 @@ class Index extends Core\Controller\AbstractFrontendAction
$articles = $this->articleRepository->getAll( $articles = $this->articleRepository->getAll(
$time, $time,
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(Articles\Installer\Schema::MODULE_NAME)
); );
$this->pagination->setTotalResults($this->articleRepository->countAll($time)); $this->pagination->setTotalResults($this->articleRepository->countAll($time));
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Categories; use ACP3\Modules\ACP3\Categories;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/categories/index/delete') ->setResourcePathDelete('admin/categories/index/delete')
->setResourcePathEdit('admin/categories/index/edit'); ->setResourcePathEdit('admin/categories/index/edit');
......
...@@ -9,6 +9,7 @@ namespace ACP3\Modules\ACP3\Comments\Controller\Admin\Details; ...@@ -9,6 +9,7 @@ namespace ACP3\Modules\ACP3\Comments\Controller\Admin\Details;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Comments; use ACP3\Modules\ACP3\Comments;
use ACP3\Modules\ACP3\System; use ACP3\Modules\ACP3\System;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -61,7 +62,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -61,7 +62,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setResults($comments) ->setResults($comments)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/comments/details/delete/id_' . $id) ->setResourcePathDelete('admin/comments/details/delete/id_' . $id)
->setResourcePathEdit('admin/comments/details/edit'); ->setResourcePathEdit('admin/comments/details/edit');
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Comments\Controller\Admin\Index; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Comments\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Comments; use ACP3\Modules\ACP3\Comments;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setResults($this->commentRepository->getCommentsGroupedByModule()) ->setResults($this->commentRepository->getCommentsGroupedByModule())
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/comments/index/delete') ->setResourcePathDelete('admin/comments/index/delete')
->setResourcePathEdit('admin/comments/details/index'); ->setResourcePathEdit('admin/comments/details/index');
......
...@@ -56,7 +56,7 @@ class Index extends AbstractFrontendAction ...@@ -56,7 +56,7 @@ class Index extends AbstractFrontendAction
$this->modules->getModuleId($module), $this->modules->getModuleId($module),
$entryId, $entryId,
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(Comments\Installer\Schema::MODULE_NAME)
); );
$cComments = count($comments); $cComments = count($comments);
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Emoticons\Controller\Admin\Index; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Emoticons\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Emoticons; use ACP3\Modules\ACP3\Emoticons;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -41,7 +42,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -41,7 +42,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/emoticons/index/delete') ->setResourcePathDelete('admin/emoticons/index/delete')
->setResourcePathEdit('admin/emoticons/index/edit'); ->setResourcePathEdit('admin/emoticons/index/edit');
......
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
namespace ACP3\Modules\ACP3\Files\Controller\Admin\Index; namespace ACP3\Modules\ACP3\Files\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Categories;
use ACP3\Modules\ACP3\Comments;
use ACP3\Modules\ACP3\Files; use ACP3\Modules\ACP3\Files;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -46,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -46,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/files/index/delete') ->setResourcePathDelete('admin/files/index/delete')
->setResourcePathEdit('admin/files/index/edit'); ->setResourcePathEdit('admin/files/index/edit');
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Gallery\Controller\Admin\Index; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Gallery\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Gallery; use ACP3\Modules\ACP3\Gallery;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Edit * Class Edit
...@@ -102,7 +103,7 @@ class Edit extends Core\Controller\AbstractAdminAction ...@@ -102,7 +103,7 @@ class Edit extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setResults($pictures) ->setResults($pictures)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/gallery/pictures/delete/id_' . $id) ->setResourcePathDelete('admin/gallery/pictures/delete/id_' . $id)
->setResourcePathEdit('admin/gallery/pictures/edit'); ->setResourcePathEdit('admin/gallery/pictures/edit');
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Gallery\Controller\Admin\Index; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Gallery\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Gallery; use ACP3\Modules\ACP3\Gallery;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/gallery/index/delete') ->setResourcePathDelete('admin/gallery/index/delete')
->setResourcePathEdit('admin/gallery/index/edit'); ->setResourcePathEdit('admin/gallery/index/edit');
......
...@@ -67,7 +67,7 @@ class Index extends AbstractAction ...@@ -67,7 +67,7 @@ class Index extends AbstractAction
'galleries' => $this->galleryRepository->getAll( 'galleries' => $this->galleryRepository->getAll(
$time, $time,
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(Gallery\Installer\Schema::MODULE_NAME)
), ),
'dateformat' => $this->settings['dateformat'], 'dateformat' => $this->settings['dateformat'],
'pagination' => $this->pagination->render() 'pagination' => $this->pagination->render()
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
namespace ACP3\Modules\ACP3\Guestbook\Controller\Admin\Index; namespace ACP3\Modules\ACP3\Guestbook\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Emoticons;
use ACP3\Modules\ACP3\Guestbook; use ACP3\Modules\ACP3\Guestbook;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -45,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -45,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/guestbook/index/delete') ->setResourcePathDelete('admin/guestbook/index/delete')
->setResourcePathEdit('admin/guestbook/index/edit'); ->setResourcePathEdit('admin/guestbook/index/edit');
......
...@@ -55,7 +55,7 @@ class Index extends AbstractAction ...@@ -55,7 +55,7 @@ class Index extends AbstractAction
$guestbook = $this->guestbookRepository->getAll( $guestbook = $this->guestbookRepository->getAll(
$this->guestbookSettings['notify'], $this->guestbookSettings['notify'],
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(Guestbook\Installer\Schema::MODULE_NAME)
); );
$cGuestbook = count($guestbook); $cGuestbook = count($guestbook);
......
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
namespace ACP3\Modules\ACP3\News\Controller\Admin\Index; namespace ACP3\Modules\ACP3\News\Controller\Admin\Index;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Categories;
use ACP3\Modules\ACP3\Comments;
use ACP3\Modules\ACP3\News; use ACP3\Modules\ACP3\News;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -46,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -46,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');
$dataGrid $dataGrid
->setRepository($this->dataGridRepository) ->setRepository($this->dataGridRepository)
->setRecordsPerPage($this->user->getEntriesPerPage()) ->setRecordsPerPage($this->resultsPerPage->getResultsPerPage(Schema::MODULE_NAME))
->setIdentifier('#acp-table') ->setIdentifier('#acp-table')
->setResourcePathDelete('admin/news/index/delete') ->setResourcePathDelete('admin/news/index/delete')
->setResourcePathEdit('admin/news/index/edit'); ->setResourcePathEdit('admin/news/index/edit');
......
...@@ -140,13 +140,13 @@ class Index extends AbstractAction ...@@ -140,13 +140,13 @@ class Index extends AbstractAction
$categoryId, $categoryId,
$time, $time,
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME)
); );
} else { } else {
$news = $this->newsRepository->getAll( $news = $this->newsRepository->getAll(
$time, $time,
$this->pagination->getResultsStartOffset(), $this->pagination->getResultsStartOffset(),
$this->user->getEntriesPerPage() $this->resultsPerPage->getResultsPerPage(News\Installer\Schema::MODULE_NAME)
); );
} }
......
...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Newsletter\Controller\Admin\Accounts; ...@@ -8,6 +8,7 @@ namespace ACP3\Modules\ACP3\Newsletter\Controller\Admin\Accounts;
use ACP3\Core; use ACP3\Core;
use ACP3\Modules\ACP3\Newsletter; use ACP3\Modules\ACP3\Newsletter;
use ACP3\Modules\ACP3\System\Installer\Schema;
/** /**
* Class Index * Class Index
...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction ...@@ -44,7 +45,7 @@ class Index extends Core\Controller\AbstractAdminAction
$dataGrid = $this->get('core.helpers.data_grid'); $dataGrid = $this->get('core.helpers.data_grid');