ObjectController: distinct templates and objects
This commit is contained in:
parent
5a3fead131
commit
03436efa29
|
@ -102,15 +102,19 @@ abstract class ObjectController extends ActionController
|
||||||
$ltype = strtolower($type);
|
$ltype = strtolower($type);
|
||||||
|
|
||||||
$url = sprintf('director/%ss', $ltype);
|
$url = sprintf('director/%ss', $ltype);
|
||||||
$this->view->form = $this->loadForm('icinga' . ucfirst($type))
|
$form = $this->view->form = $this->loadForm('icinga' . ucfirst($type))
|
||||||
->setDb($this->db())
|
->setDb($this->db())
|
||||||
->setSuccessUrl($url);
|
->setSuccessUrl($url);
|
||||||
|
|
||||||
$this->view->title = sprintf(
|
if ($this->params->get('type') === 'template') {
|
||||||
$this->translate('Add new Icinga %s'),
|
$form->setObjectType('template');
|
||||||
ucfirst($ltype)
|
$title = $this->translate('Add new Icinga %s');
|
||||||
);
|
} else {
|
||||||
$this->view->form->handleRequest();
|
$title = $this->translate('Add new Icinga %s template');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->view->title = sprintf($title, ucfirst($ltype));
|
||||||
|
$form->handleRequest();
|
||||||
$this->render('object/form', null, true);
|
$this->render('object/form', null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue