mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ObjectController: improve title settings, clean up
This commit is contained in:
parent
51672e33bd
commit
299251276e
@ -85,17 +85,21 @@ abstract class ObjectController extends ActionController
|
|||||||
'icinga' . ucfirst($type)
|
'icinga' . ucfirst($type)
|
||||||
)->setDb($this->db());
|
)->setDb($this->db());
|
||||||
$form->loadObject($this->params->get('name'));
|
$form->loadObject($this->params->get('name'));
|
||||||
|
$object = $form->getObject();
|
||||||
|
|
||||||
$url = Url::fromPath(
|
$url = Url::fromPath(
|
||||||
sprintf('director/%s', $ltype),
|
sprintf('director/%s', $ltype),
|
||||||
array('name' => $form->getObject()->object_name)
|
array('name' => $object->object_name)
|
||||||
);
|
);
|
||||||
$form->setSuccessUrl($url);
|
$form->setSuccessUrl($url);
|
||||||
|
|
||||||
$this->view->title = sprintf(
|
if ($object->isTemplate()) {
|
||||||
$this->translate('Modify Icinga %s'),
|
$title = $this->translate('Modify Icinga %s template');
|
||||||
ucfirst($ltype)
|
} else {
|
||||||
);
|
$title = $this->translate('Modify Icinga %s');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->view->title = sprintf($title, ucfirst($ltype));
|
||||||
$this->view->form->handleRequest();
|
$this->view->form->handleRequest();
|
||||||
$this->render('object/form', null, true);
|
$this->render('object/form', null, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user