From 24b201db13d4b6b120fff359744fba79bc11daed Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 3 May 2016 09:09:01 +0200 Subject: [PATCH] Object/CommandController: unify titles --- application/controllers/CommandController.php | 7 +++++-- library/Director/Web/Controller/ObjectController.php | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/application/controllers/CommandController.php b/application/controllers/CommandController.php index 0327b40a..b546ced1 100644 --- a/application/controllers/CommandController.php +++ b/application/controllers/CommandController.php @@ -10,7 +10,7 @@ class CommandController extends ObjectController public function init() { parent::init(); - if ($this->object) { + if ($this->object && ! $this->object->isExternal()) { $this->getTabs()->add('arguments', array( 'url' => 'director/command/arguments', 'urlParams' => array('name' => $this->object->object_name), @@ -22,7 +22,10 @@ class CommandController extends ObjectController public function argumentsAction() { $this->getTabs()->activate('arguments'); - $this->view->title = $this->translate('Command arguments'); + $this->view->title = sprintf( + $this->translate('Command arguments: %s'), + $this->object->object_name + ); $this->view->table = $this ->loadTable('icingaCommandArgument') diff --git a/library/Director/Web/Controller/ObjectController.php b/library/Director/Web/Controller/ObjectController.php index b38525b7..c435efaf 100644 --- a/library/Director/Web/Controller/ObjectController.php +++ b/library/Director/Web/Controller/ObjectController.php @@ -239,10 +239,9 @@ abstract class ObjectController extends ActionController $type = $this->getType(); $this->getTabs()->activate('fields'); - $title = $this->translate('%s template "%s": custom fields'); + $this->view->title = sprintf( - $title, - $this->translate(ucfirst($type)), + $this->translate('Custom fields: %s'), $object->object_name );