ObjectController: link back to template usage
This commit is contained in:
parent
a0a12ce3d1
commit
99ab56e6f9
|
@ -158,11 +158,24 @@ abstract class ObjectController extends ActionController
|
||||||
|
|
||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
|
$type = $this->getType();
|
||||||
$object = $this->object;
|
$object = $this->object;
|
||||||
$this->addTitle($object->object_name);
|
$name = $object->getObjectName();
|
||||||
|
$this->addTitle($this->translate('Template: %s'), $name);
|
||||||
$this->tabs()->activate('modify');
|
$this->tabs()->activate('modify');
|
||||||
|
|
||||||
$formName = 'icinga' . ucfirst($this->getType());
|
if ($object->isTemplate()) {
|
||||||
|
$this->actions()->add([
|
||||||
|
Link::create(
|
||||||
|
$this->translate('Usage'),
|
||||||
|
"director/${type}template/usage",
|
||||||
|
['name' => $name],
|
||||||
|
['class' => 'icon-sitemap']
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$formName = 'icinga' . ucfirst($type);
|
||||||
$form = $this->loadForm($formName)
|
$form = $this->loadForm($formName)
|
||||||
->setDb($this->db())
|
->setDb($this->db())
|
||||||
->setAuth($this->Auth())
|
->setAuth($this->Auth())
|
||||||
|
|
Loading…
Reference in New Issue