create event object for module delete action

This commit is contained in:
Manuel Raynaud
2013-10-21 10:26:51 +02:00
parent 1545987d51
commit a10fa20340
7 changed files with 105 additions and 5 deletions

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Module\ModuleDeleteEvent;
use Thelia\Core\Event\Module\ModuleToggleActivationEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Module\ModuleManagement;
@@ -82,4 +83,21 @@ class ModuleController extends BaseAdminController
return $response;
}
public function deleteAction()
{
if (null !== $response = $this->checkAuth("admin.module.delete")) return $response;
try {
$module_id = $this->getRequest()->get('module_id');
$deleteEvent = new ModuleDeleteEvent($module_id);
$this->dispatch(TheliaEvents::MODULE_DELETE, $deleteEvent);
} catch (\Exception $e) {
}
}
}