diff --git a/core/lib/Thelia/Action/Module.php b/core/lib/Thelia/Action/Module.php index d27bedd1f..286779667 100644 --- a/core/lib/Thelia/Action/Module.php +++ b/core/lib/Thelia/Action/Module.php @@ -33,6 +33,7 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Map\ModuleTableMap; use Thelia\Model\ModuleQuery; use Thelia\Module\BaseModule; +use Thelia\Core\Event\UpdatePositionEvent; /** * Class Module @@ -122,6 +123,16 @@ class Module extends BaseAction implements EventSubscriberInterface } } + /** + * Changes position, selecting absolute ou relative change. + * + * @param CategoryChangePositionEvent $event + */ + public function updatePosition(UpdatePositionEvent $event) + { + return $this->genericUpdatePosition(ModuleQuery::create(), $event); + } + protected function cacheClear() { $cacheEvent = new CacheEvent($this->container->getParameter('kernel.cache_dir')); @@ -153,6 +164,7 @@ class Module extends BaseAction implements EventSubscriberInterface { return array( TheliaEvents::MODULE_TOGGLE_ACTIVATION => array('toggleActivation', 128), + TheliaEvents::MODULE_UPDATE_POSITION => array('updatePosition', 128), TheliaEvents::MODULE_DELETE => array('delete', 128), TheliaEvents::MODULE_UPDATE => array('update', 128), ); diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index 591e5c0e7..1aa99c0aa 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -954,6 +954,10 @@ Thelia\Controller\Admin\ModuleController::deleteAction + + Thelia\Controller\Admin\ModuleController::updatePositionAction + +