diff --git a/Config/config.xml b/Config/config.xml index 61e84d1..0e0bed4 100755 --- a/Config/config.xml +++ b/Config/config.xml @@ -28,6 +28,8 @@ + + diff --git a/Config/module.xml b/Config/module.xml index 628e697..47f4401 100755 --- a/Config/module.xml +++ b/Config/module.xml @@ -7,7 +7,7 @@ Gérer la réécriture d'url - 2.1.1 + 2.1.2 Vincent Lopes, Gilles Bourgeat, Tom Pradat vlopes@openstudio.fr, gbourgeat@openstudio.fr, tpradat@openstudio.fr diff --git a/Config/routing.xml b/Config/routing.xml index 8db07fa..e7ad916 100755 --- a/Config/routing.xml +++ b/Config/routing.xml @@ -4,9 +4,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - - RewriteUrl\Controller\Admin\ModuleConfigController::viewConfigAction - RewriteUrl\Controller\Admin\ModuleConfigController::getDatatableRules diff --git a/Controller/Admin/ModuleConfigController.php b/Controller/Admin/ModuleConfigController.php index 39059ad..ab939f1 100644 --- a/Controller/Admin/ModuleConfigController.php +++ b/Controller/Admin/ModuleConfigController.php @@ -93,6 +93,7 @@ public function getDatatableRules(Request $request) 'Value' => $this->renderRaw( "RewriteUrl/tab-value-render", [ + "ID" => $row['Id'], "REWRITE_URL_PARAMS" => $rewriteUrlRuleParams, "VALUE" => $row['Value'], ] diff --git a/Hook/ConfigurationHook.php b/Hook/ConfigurationHook.php index 860a501..2ba8cd6 100644 --- a/Hook/ConfigurationHook.php +++ b/Hook/ConfigurationHook.php @@ -14,6 +14,7 @@ use Thelia\Core\Event\Hook\HookRenderEvent; use Thelia\Core\Hook\BaseHook; +use Thelia\Model\ConfigQuery; /** * Class ConfigurationHook @@ -22,10 +23,34 @@ */ class ConfigurationHook extends BaseHook { + public function onModuleConfiguration(HookRenderEvent $event) + { + $event->add( + $this->render( + 'RewriteUrl/module-configuration.html', + [ + "isRewritingEnabled" => ConfigQuery::isRewritingEnable() + ] + ) + ); + } + + public function onModuleConfigurationJavascript(HookRenderEvent $event) + { + $event->add( + $this->render( + 'RewriteUrl/module-configuration-js.html', + [ + "isRewritingEnabled" => ConfigQuery::isRewritingEnable() + ] + ) + ); + } + public function onConfigurationCatalogTop(HookRenderEvent $event) { $event->add($this->render( 'configuration-catalog.html' )); } -} \ No newline at end of file +} diff --git a/Service/RewritingRouterLast.php b/Service/RewritingRouterLast.php index 9d45c9c..d9a1220 100644 --- a/Service/RewritingRouterLast.php +++ b/Service/RewritingRouterLast.php @@ -31,6 +31,7 @@ public function matchRequest(Request $request) : array $pathInfo = $request instanceof TheliaRequest ? $request->getRealPathInfo() : $request->getPathInfo(); + /** @var RewriteurlRule $rule */ foreach ($ruleCollection as $rule) { if ($rule->isMatching($pathInfo, $request->query->all())) { diff --git a/templates/backOffice/default/RewriteUrl/module-configuration.html b/templates/backOffice/default/RewriteUrl/module-configuration.html index c55bb42..798718f 100644 --- a/templates/backOffice/default/RewriteUrl/module-configuration.html +++ b/templates/backOffice/default/RewriteUrl/module-configuration.html @@ -1,18 +1,3 @@ -{extends file="admin-layout.tpl"} - -{block name="no-return-functions"} -{$admin_current_location = 'modules'} -{/block} - -{block name="page-title"}{intl l='RewriteUrl'}{/block} - -{block name="check-auth"} -{check_auth role="ADMIN" module=$module_code access="view" login_tpl="/admin/login"} -{/block} - -{block name="main-content"} -{default_translation_domain domain='rewriteurl.bo.default'} -
@@ -23,8 +8,6 @@
- {hook name="module.configuration" location="module_configuration" modulecode="$module_code"} -
@@ -155,14 +138,6 @@
-{/block} - -{block name="javascript-initialization"} {include file="RewriteUrl/module-configuration-js.html"} -{/block} - - -{block name="javascript-last-call"} -{/block}