mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ObjectController: simpler title logic
This commit is contained in:
parent
215f42926f
commit
2d29421521
@ -100,14 +100,7 @@ abstract class ObjectController extends ActionController
|
|||||||
);
|
);
|
||||||
$form->setSuccessUrl($url);
|
$form->setSuccessUrl($url);
|
||||||
|
|
||||||
if ($object->isTemplate()) {
|
$this->view->title = sprintf($this->translate('Modify %s'), ucfirst($ltype));
|
||||||
$title = $this->translate('Modify Icinga %s template');
|
|
||||||
$form->setObjectType('template'); // WHY??
|
|
||||||
} else {
|
|
||||||
$title = $this->translate('Modify Icinga %s');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->view->title = sprintf($title, ucfirst($ltype));
|
|
||||||
$this->view->form->handleRequest();
|
$this->view->form->handleRequest();
|
||||||
|
|
||||||
$this->view->actionLinks = $this->view->icon('paste') . ' '
|
$this->view->actionLinks = $this->view->icon('paste') . ' '
|
||||||
@ -131,14 +124,11 @@ abstract class ObjectController extends ActionController
|
|||||||
->setDb($this->db())
|
->setDb($this->db())
|
||||||
->setSuccessUrl($url);
|
->setSuccessUrl($url);
|
||||||
|
|
||||||
if ($this->params->get('type') === 'template') {
|
$this->view->title = sprintf(
|
||||||
$form->setObjectType('template');
|
$this->translate('Add new Icinga %s'),
|
||||||
$title = $this->translate('Add new Icinga %s template');
|
ucfirst($ltype)
|
||||||
} else {
|
);
|
||||||
$title = $this->translate('Add new Icinga %s');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->view->title = sprintf($title, ucfirst($ltype));
|
|
||||||
$form->handleRequest();
|
$form->handleRequest();
|
||||||
$this->render('object/form', null, true);
|
$this->render('object/form', null, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user