Add proper titles to the comments component view

refs #8458
This commit is contained in:
Johannes Meyer 2015-02-23 17:27:13 +01:00
parent 89ed498069
commit 9793bd52c7
1 changed files with 19 additions and 12 deletions

View File

@ -1,27 +1,34 @@
<tr>
<th><?= $this->translate('Comments') ?></th>
<th><?= $this->translate('Comments'); ?></th>
<td>
<?php if ($this->hasPermission('monitoring/command/comment/add')) {
/** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if ($object->getType() === $object::TYPE_HOST) {
$addCommentLink = $this->href(
echo $this->qlink(
$this->icon('comment') . ' ' . $this->translate('Add comment'),
'monitoring/host/add-comment',
array('host' => $object->getName())
array('host' => $object->getName()),
array(
'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this host')
),
false
);
} else {
$addCommentLink = $this->href(
echo $this->qlink(
$this->icon('comment') . ' ' . $this->translate('Add comment'),
'monitoring/service/add-comment',
array('host' => $object->getHost()->getName(), 'service' => $object->getName())
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array(
'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this service')
),
false
);
}
?>
<a href="<?= $addCommentLink ?>" data-base-target="_self">
<?= $this->icon('comment') ?>
<?= $this->translate('Add comment') ?>
</a>
<?php } else {
} else {
echo '&#45;';
} // endif ?>
} ?>
</td>
</tr>