parent
f3f7fa381b
commit
8cff607b5d
|
@ -202,7 +202,6 @@ class NavigationController extends Controller
|
||||||
$form->setRedirectUrl('navigation');
|
$form->setRedirectUrl('navigation');
|
||||||
$form->setUser($this->Auth()->getUser());
|
$form->setUser($this->Auth()->getUser());
|
||||||
$form->setItemTypes($this->listItemTypes());
|
$form->setItemTypes($this->listItemTypes());
|
||||||
$form->setTitle($this->translate('Create New Navigation Item'));
|
|
||||||
$form->addDescription($this->translate('Create a new navigation item, such as a menu entry or dashlet.'));
|
$form->addDescription($this->translate('Create a new navigation item, such as a menu entry or dashlet.'));
|
||||||
|
|
||||||
// TODO: Fetch all "safe" parameters from the url and populate them
|
// TODO: Fetch all "safe" parameters from the url and populate them
|
||||||
|
@ -231,8 +230,7 @@ class NavigationController extends Controller
|
||||||
});
|
});
|
||||||
$form->handleRequest();
|
$form->handleRequest();
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->renderForm($form, $this->translate('New Navigation Item'));
|
||||||
$this->render('form');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -256,7 +254,6 @@ class NavigationController extends Controller
|
||||||
$form->setShareConfig(Config::navigation($itemType));
|
$form->setShareConfig(Config::navigation($itemType));
|
||||||
$form->setUserConfig(Config::navigation($itemType, $itemOwner));
|
$form->setUserConfig(Config::navigation($itemType, $itemOwner));
|
||||||
$form->setRedirectUrl($referrer === 'shared' ? 'navigation/shared' : 'navigation');
|
$form->setRedirectUrl($referrer === 'shared' ? 'navigation/shared' : 'navigation');
|
||||||
$form->setTitle(sprintf($this->translate('Edit %s %s'), $this->getItemLabel($itemType), $itemName));
|
|
||||||
$form->setOnSuccess(function (NavigationConfigForm $form) use ($itemName) {
|
$form->setOnSuccess(function (NavigationConfigForm $form) use ($itemName) {
|
||||||
$data = array_map(
|
$data = array_map(
|
||||||
function ($v) {
|
function ($v) {
|
||||||
|
@ -293,8 +290,7 @@ class NavigationController extends Controller
|
||||||
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
|
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->renderForm($form, $this->translate('Update Navigation Item'));
|
||||||
$this->render('form');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -313,7 +309,6 @@ class NavigationController extends Controller
|
||||||
|
|
||||||
$form = new ConfirmRemovalForm();
|
$form = new ConfirmRemovalForm();
|
||||||
$form->setRedirectUrl('navigation');
|
$form->setRedirectUrl('navigation');
|
||||||
$form->setTitle(sprintf($this->translate('Remove %s %s'), $this->getItemLabel($itemType), $itemName));
|
|
||||||
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($itemName, $navigationConfigForm) {
|
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($itemName, $navigationConfigForm) {
|
||||||
try {
|
try {
|
||||||
$itemConfig = $navigationConfigForm->delete($itemName);
|
$itemConfig = $navigationConfigForm->delete($itemName);
|
||||||
|
@ -338,8 +333,7 @@ class NavigationController extends Controller
|
||||||
});
|
});
|
||||||
$form->handleRequest();
|
$form->handleRequest();
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->renderForm($form, $this->translate('Remove Navigation Item'));
|
||||||
$this->render('form');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
<div class="controls">
|
|
||||||
<?= $tabs->showOnlyCloseButton(); ?>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<?= $form; ?>
|
|
||||||
</div>
|
|
Loading…
Reference in New Issue