diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 54c8b91ad..d6e6328c2 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -160,6 +160,7 @@ class ConfigController extends Controller $module = $form->getValue('identifier'); Icinga::app()->getModuleManager()->enableModule($module); Notification::success(sprintf($this->translate('Module "%s" enabled'), $module)); + $form->onSuccess(); $this->rerenderLayout()->reloadCss()->redirectNow('config/modules'); }); @@ -185,6 +186,7 @@ class ConfigController extends Controller $module = $form->getValue('identifier'); Icinga::app()->getModuleManager()->disableModule($module); Notification::success(sprintf($this->translate('Module "%s" disabled'), $module)); + $form->onSuccess(); $this->rerenderLayout()->reloadCss()->redirectNow('config/modules'); }); diff --git a/application/forms/ActionForm.php b/application/forms/ActionForm.php index def3a52e3..5b5b6edc5 100644 --- a/application/forms/ActionForm.php +++ b/application/forms/ActionForm.php @@ -3,6 +3,7 @@ namespace Icinga\Forms; +use Icinga\Application\Hook\ConfigFormEventsHook; use Icinga\Web\Form; class ActionForm extends Form @@ -58,4 +59,20 @@ class ActionForm extends Form ] ); } + + public function isValid($formData) + { + $valid = parent::isValid($formData); + + if ($valid) { + $valid = ConfigFormEventsHook::runIsValid($this); + } + + return $valid; + } + + public function onSuccess() + { + ConfigFormEventsHook::runOnSuccess($this); + } }