Commit 2ade728c authored by Tino Goratsch's avatar Tino Goratsch

Merge branch 'feature/controller-refactoring' into develop

parents 2edf73f8 dacfb3d0
......@@ -14,21 +14,6 @@ use ACP3\Core;
*/
abstract class AbstractAdminAction extends Core\Controller\AbstractFrontendAction
{
/**
* @var \ACP3\Core\Session\SessionHandlerInterface
*/
protected $session;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
*/
public function __construct(Context\AdminContext $context)
{
parent::__construct($context);
$this->session = $context->getSession();
}
/**
* @return $this
* @throws \ACP3\Core\Authentication\Exception\UnauthorizedAccessException
......
......@@ -10,41 +10,9 @@ use ACP3\Core;
/**
* Class AdminContext
* @package ACP3\Core\Controller\Context
*
* @deprecated since version 4.5.0, to be removed in version 5.0.0
*/
class AdminContext extends FrontendContext
{
/**
* @var \ACP3\Core\Session\SessionHandlerInterface
*/
protected $session;
/**
* AdminContext constructor.
*
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Session\SessionHandlerInterface $session
*/
public function __construct(
Core\Controller\Context\FrontendContext $context,
Core\Session\SessionHandlerInterface $session
) {
parent::__construct(
$context,
$context->getAssets(),
$context->getBreadcrumb(),
$context->getTitle(),
$context->getActionHelper(),
$context->getResponse()
);
$this->session = $session;
}
/**
* @return \ACP3\Core\Session\SessionHandlerInterface
*/
public function getSession()
{
return $this->session;
}
}
......@@ -20,10 +20,9 @@ services:
core.context.admin:
class: ACP3\Core\Controller\Context\AdminContext
arguments:
- '@core.context.frontend'
- '@core.session'
parent: core.context.frontend
public: false
deprecated: 'The "%service_id%" service is deprecated. Use "core.context.frontend" instead'
core.context.frontend:
class: ACP3\Core\Controller\Context\FrontendContext
......
......@@ -28,11 +28,11 @@ abstract class AbstractFormAction extends AbstractAdminAction
/**
* AbstractFormAction constructor.
* @param Core\Controller\Context\AdminContext $context
* @param Core\Controller\Context\FrontendContext $context
* @param Core\Helpers\Forms $formsHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Forms $formsHelper
) {
parent::__construct($context);
......
......@@ -29,14 +29,14 @@ class Create extends AbstractFormAction
protected $articlesModel;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Helpers\Forms $formsHelper
* @param Articles\Model\ArticlesModel $articlesModel
* @param \ACP3\Modules\ACP3\Articles\Validation\AdminFormValidation $adminFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Forms $formsHelper,
Articles\Model\ArticlesModel $articlesModel,
Articles\Validation\AdminFormValidation $adminFormValidation,
......
......@@ -21,11 +21,11 @@ class Delete extends Core\Controller\AbstractAdminAction
protected $articlesModel;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Articles\Model\ArticlesModel $articlesModel
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Articles\Model\ArticlesModel $articlesModel
) {
parent::__construct($context);
......
......@@ -29,14 +29,14 @@ class Edit extends AbstractFormAction
protected $articlesModel;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Helpers\Forms $formsHelper
* @param Articles\Model\ArticlesModel $articlesModel
* @param \ACP3\Modules\ACP3\Articles\Validation\AdminFormValidation $adminFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Forms $formsHelper,
Articles\Model\ArticlesModel $articlesModel,
Articles\Validation\AdminFormValidation $adminFormValidation,
......
......@@ -24,11 +24,11 @@ class Index extends Core\Controller\AbstractAdminAction
/**
* Index constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Modules\ACP3\Articles\Model\Repository\DataGridRepository $dataGridRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Articles\Model\Repository\DataGridRepository $dataGridRepository
) {
parent::__construct($context);
......
......@@ -2,7 +2,7 @@ services:
articles.controller.admin.index.create:
class: ACP3\Modules\ACP3\Articles\Controller\Admin\Index\Create
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@core.helpers.forms'
- '@articles.model'
- '@articles.validator'
......@@ -13,13 +13,13 @@ services:
articles.controller.admin.index.delete:
class: ACP3\Modules\ACP3\Articles\Controller\Admin\Index\Delete
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@articles.model'
articles.controller.admin.index.edit:
class: ACP3\Modules\ACP3\Articles\Controller\Admin\Index\Edit
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@core.helpers.forms'
- '@articles.model'
- '@articles.validator'
......@@ -30,7 +30,7 @@ services:
articles.controller.admin.index.index:
class: ACP3\Modules\ACP3\Articles\Controller\Admin\Index\Index
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@articles.model.data_grid_repository'
articles.controller.frontend.index.details:
......
......@@ -33,14 +33,14 @@ class Create extends Core\Controller\AbstractAdminAction
protected $categoriesModel;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Helpers\Forms $formsHelper
* @param Categories\Model\CategoriesModel $categoriesModel
* @param \ACP3\Modules\ACP3\Categories\Validation\AdminFormValidation $adminFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Forms $formsHelper,
Categories\Model\CategoriesModel $categoriesModel,
Categories\Validation\AdminFormValidation $adminFormValidation,
......
......@@ -27,12 +27,12 @@ class Delete extends Core\Controller\AbstractAdminAction
/**
* Delete constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Categories\Model\CategoriesModel $categoriesModel
* @param \ACP3\Modules\ACP3\Categories\Cache $categoriesCache
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Categories\Model\CategoriesModel $categoriesModel,
Categories\Cache $categoriesCache
) {
......
......@@ -29,13 +29,13 @@ class Edit extends Core\Controller\AbstractAdminAction
protected $categoriesModel;
/**
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Categories\Model\CategoriesModel $categoriesModel
* @param \ACP3\Modules\ACP3\Categories\Validation\AdminFormValidation $adminFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Categories\Model\CategoriesModel $categoriesModel,
Categories\Validation\AdminFormValidation $adminFormValidation,
Core\Helpers\FormToken $formTokenHelper)
......
......@@ -24,11 +24,11 @@ class Index extends Core\Controller\AbstractAdminAction
/**
* Index constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Modules\ACP3\Categories\Model\Repository\DataGridRepository $dataGridRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Categories\Model\Repository\DataGridRepository $dataGridRepository
) {
parent::__construct($context);
......
......@@ -27,12 +27,12 @@ class Settings extends Core\Controller\AbstractAdminAction
/**
* Settings constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Modules\ACP3\Categories\Validation\AdminSettingsFormValidation $adminSettingsFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Categories\Validation\AdminSettingsFormValidation $adminSettingsFormValidation,
Core\Helpers\FormToken $formTokenHelper)
{
......
......@@ -2,7 +2,7 @@ services:
categories.controller.admin.index.create:
class: ACP3\Modules\ACP3\Categories\Controller\Admin\Index\Create
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@core.helpers.forms'
- '@categories.model.categories_model'
- '@categories.validator'
......@@ -11,14 +11,14 @@ services:
categories.controller.admin.index.delete:
class: ACP3\Modules\ACP3\Categories\Controller\Admin\Index\Delete
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@categories.model.categories_model'
- '@categories.cache'
categories.controller.admin.index.edit:
class: ACP3\Modules\ACP3\Categories\Controller\Admin\Index\Edit
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@categories.model.categories_model'
- '@categories.validator'
- '@core.helpers.formToken'
......@@ -26,12 +26,12 @@ services:
categories.controller.admin.index.index:
class: ACP3\Modules\ACP3\Categories\Controller\Admin\Index\Index
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@categories.model.data_grid_repository'
categories.controller.admin.index.settings:
class: ACP3\Modules\ACP3\Categories\Controller\Admin\Index\Settings
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@categories.validation.admin_settings_form_validation'
- '@core.helpers.formToken'
......@@ -28,12 +28,12 @@ class Delete extends Core\Controller\AbstractAdminAction
/**
* Delete constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Comments\Model\CommentsModel $commentsModel
* @param \ACP3\Modules\ACP3\Comments\Model\Repository\CommentRepository $commentRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Comments\Model\CommentsModel $commentsModel,
Comments\Model\Repository\CommentRepository $commentRepository
) {
......
......@@ -33,13 +33,13 @@ class Edit extends Core\Controller\AbstractAdminAction
/**
* Details constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Comments\Model\CommentsModel $commentsModel
* @param \ACP3\Modules\ACP3\Comments\Validation\AdminFormValidation $adminFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Comments\Model\CommentsModel $commentsModel,
Comments\Validation\AdminFormValidation $adminFormValidation,
Core\Helpers\FormToken $formTokenHelper)
......
......@@ -28,12 +28,12 @@ class Index extends Core\Controller\AbstractAdminAction
/**
* Index constructor.
* @param Core\Controller\Context\AdminContext $context
* @param Core\Controller\Context\FrontendContext $context
* @param Comments\Model\Repository\CommentRepository $commentRepository
* @param Core\Model\Repository\ModuleAwareRepositoryInterface $systemModuleRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Comments\Model\Repository\CommentRepository $commentRepository,
Core\Model\Repository\ModuleAwareRepositoryInterface $systemModuleRepository)
{
......
......@@ -23,11 +23,11 @@ class Delete extends Core\Controller\AbstractAdminAction
/**
* Delete constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Modules\ACP3\Comments\Model\Repository\CommentRepository $commentRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Comments\Model\Repository\CommentRepository $commentRepository
) {
parent::__construct($context);
......
......@@ -24,11 +24,11 @@ class Index extends Core\Controller\AbstractAdminAction
/**
* Index constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Modules\ACP3\Comments\Model\Repository\CommentRepository $commentRepository
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Comments\Model\Repository\CommentRepository $commentRepository
) {
parent::__construct($context);
......
......@@ -31,13 +31,13 @@ class Settings extends Core\Controller\AbstractAdminAction
/**
* Settings constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Helpers\Forms $formsHelper
* @param \ACP3\Modules\ACP3\Comments\Validation\AdminSettingsFormValidation $adminSettingsFormValidation
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Forms $formsHelper,
Comments\Validation\AdminSettingsFormValidation $adminSettingsFormValidation,
Core\Helpers\FormToken $formTokenHelper
......
......@@ -2,14 +2,14 @@ services:
comments.controller.admin.details.delete:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Details\Delete
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@comments.model.comments_model'
- '@comments.model.commentrepository'
comments.controller.admin.details.edit:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Details\Edit
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@comments.model.comments_model'
- '@comments.validation.admin_form_validation'
- '@core.helpers.formToken'
......@@ -17,26 +17,26 @@ services:
comments.controller.admin.details.index:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Details\Index
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@comments.model.commentrepository'
- '@system.model.modulerepository'
comments.controller.admin.index.delete:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Index\Delete
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@comments.model.commentrepository'
comments.controller.admin.index.index:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Index\Index
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@comments.model.commentrepository'
comments.controller.admin.index.settings:
class: ACP3\Modules\ACP3\Comments\Controller\Admin\Index\Settings
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@core.helpers.forms'
- '@comments.validation.admin_settings_form_validation'
- '@core.helpers.formToken'
......
......@@ -31,13 +31,13 @@ class Settings extends Core\Controller\AbstractAdminAction
/**
* Index constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Core\Helpers\Secure $secureHelper
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
* @param \ACP3\Modules\ACP3\Contact\Validation\AdminSettingsFormValidation $adminSettingsFormValidation
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\Secure $secureHelper,
Core\Helpers\FormToken $formTokenHelper,
Contact\Validation\AdminSettingsFormValidation $adminSettingsFormValidation
......
......@@ -6,7 +6,7 @@ services:
contact.controller.admin.index.settings:
class: ACP3\Modules\ACP3\Contact\Controller\Admin\Index\Settings
arguments:
- '@core.context.admin'
- '@core.context.frontend'
- '@core.helpers.secure'
- '@core.helpers.formToken'
- '@contact.validation.admin_settings_form_validation'
......
......@@ -31,13 +31,13 @@ class Create extends Core\Controller\AbstractAdminAction
/**
* Create constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param \ACP3\Core\Helpers\FormToken $formTokenHelper
* @param Emoticons\Model\EmoticonsModel $emoticonsModel
* @param \ACP3\Modules\ACP3\Emoticons\Validation\AdminFormValidation $adminFormValidation
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Core\Helpers\FormToken $formTokenHelper,
Emoticons\Model\EmoticonsModel $emoticonsModel,
Emoticons\Validation\AdminFormValidation $adminFormValidation)
......
......@@ -23,11 +23,11 @@ class Delete extends Core\Controller\AbstractAdminAction
/**
* Delete constructor.
*
* @param \ACP3\Core\Controller\Context\AdminContext $context
* @param \ACP3\Core\Controller\Context\FrontendContext $context
* @param Emoticons\Model\EmoticonsModel $emoticonsModel
*/
public function __construct(
Core\Controller\Context\AdminContext $context,
Core\Controller\Context\FrontendContext $context,
Emoticons\Model\EmoticonsModel $emoticonsModel
) {
parent::__construct($context);
......
......@@ -31,13 +31,13 @@ class Edit extends Core\Controller\AbstractAdminAction
/**