Commit e8927524 authored by Tino Goratsch's avatar Tino Goratsch

next part at trying to get the ACP3 working without the SEO module

parent 00488989
......@@ -2,7 +2,6 @@
namespace ACP3\Core\Helpers\Formatter;
use ACP3\Core;
use ACP3\Modules\ACP3\Seo\Validation\ValidationRules\UriAliasValidationRule;
/**
* Class RewriteInternalUri
......@@ -27,31 +26,31 @@ class RewriteInternalUri
*/
protected $router;
/**
* @var \ACP3\Modules\ACP3\Seo\Validation\ValidationRules\UriAliasValidationRule
* @var Core\Validation\ValidationRules\InternalUriValidationRule
*/
protected $uriAliasValidationRule;
private $internalUriValidationRule;
/**
* RewriteInternalUri constructor.
*
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules\Helper\ControllerActionExists $controllerActionExists
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Router\RouterInterface $router
* @param \ACP3\Modules\ACP3\Seo\Validation\ValidationRules\UriAliasValidationRule $uriAliasValidationRule
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules\Helper\ControllerActionExists $controllerActionExists
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Router\RouterInterface $router
* @param Core\Validation\ValidationRules\InternalUriValidationRule $internalUriValidationRule
*/
public function __construct(
Core\Environment\ApplicationPath $appPath,
Core\Modules\Helper\ControllerActionExists $controllerActionExists,
Core\Http\RequestInterface $request,
Core\Router\RouterInterface $router,
UriAliasValidationRule $uriAliasValidationRule
Core\Validation\ValidationRules\InternalUriValidationRule $internalUriValidationRule
) {
$this->appPath = $appPath;
$this->controllerActionExists = $controllerActionExists;
$this->request = $request;
$this->router = $router;
$this->uriAliasValidationRule = $uriAliasValidationRule;
$this->internalUriValidationRule = $internalUriValidationRule;
}
/**
......@@ -79,7 +78,7 @@ class RewriteInternalUri
*/
private function rewriteInternalUriCallback(array $matches)
{
if ($this->uriAliasValidationRule->isValid($matches[7]) !== true) {
if ($this->internalUriValidationRule->isValid($matches[7]) === true) {
$resourceParts = explode('/', $matches[7]);
$path = $this->getResourcePath($resourceParts);
if ($this->controllerActionExists->controllerActionExists($path) === true) {
......
......@@ -11,5 +11,5 @@ services:
core.breadcrumb.title:
class: ACP3\Core\Breadcrumb\Title
arguments:
- '@core.event_dispatcher'
- '@core.breadcrumb'
- '@core.event_dispatcher'
......@@ -93,7 +93,7 @@ services:
- '@core.modules.helper.controllerActionExists'
- '@core.http.request'
- '@core.router'
- '@seo.validation.validation_rules.uri_alias_validation_rule'
- '@core.validation.validation_rules.internal_uri_validation_rule'
slugify:
class: Cocur\Slugify\Slugify
......@@ -4,6 +4,7 @@ imports:
- { resource: components/application.yml }
- { resource: components/assets.yml }
- { resource: components/authentication.yml }
- { resource: components/breadcrumb.yml }
- { resource: components/controller.yml }
- { resource: components/database.yml }
- { resource: components/datagrid.yml }
......@@ -17,7 +18,6 @@ imports:
- { resource: components/view.yml }
- { resource: components/wysiwyg.yml }
- { resource: ../../Modules/ACP3/Permissions/Resources/config/services.yml }
- { resource: ../../Modules/ACP3/Seo/Resources/config/services.yml }
- { resource: ../../Modules/ACP3/System/Resources/config/services.yml }
- { resource: ../../Modules/ACP3/Users/Resources/config/services.yml }
......
......@@ -31,10 +31,10 @@ class UriAliasValidationRule extends AbstractValidationRule
/**
* UriAliasValidationRule constructor.
*
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Validation\ValidationRules\InternalUriValidationRule $internalUriValidationRule
* @param \ACP3\Core\Validation\ValidationRules\UriSafeValidationRule $uriSafeValidationRule
* @param \ACP3\Modules\ACP3\Seo\Model\Repository\SeoRepository $seoRepository
* @param \ACP3\Core\Validation\ValidationRules\UriSafeValidationRule $uriSafeValidationRule
* @param \ACP3\Modules\ACP3\Seo\Model\Repository\SeoRepository $seoRepository
*/
public function __construct(
Core\Environment\ApplicationPath $appPath,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment