mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 06:44:33 +02:00
NavigationController: Rerender the layout when adding a menu entry
refs #5600
This commit is contained in:
parent
165dc00fad
commit
c4df7e05be
@ -162,14 +162,20 @@ class NavigationController extends Controller
|
|||||||
$form->setUser($this->Auth()->getUser());
|
$form->setUser($this->Auth()->getUser());
|
||||||
$form->setShareConfig(Config::app('navigation'));
|
$form->setShareConfig(Config::app('navigation'));
|
||||||
$form->setOnSuccess(function (NavigationConfigForm $form) {
|
$form->setOnSuccess(function (NavigationConfigForm $form) {
|
||||||
|
$data = array_filter($form->getValues());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$form->add(array_filter($form->getValues()));
|
$form->add($data);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$form->error($e->getMessage());
|
$form->error($e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($form->save()) {
|
if ($form->save()) {
|
||||||
|
if (isset($data['type']) && $data['type'] === 'menu-item') {
|
||||||
|
$form->getResponse()->setRerenderLayout();
|
||||||
|
}
|
||||||
|
|
||||||
Notification::success(t('Navigation item successfully created'));
|
Notification::success(t('Navigation item successfully created'));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user