31 lines
859 B
PHTML
31 lines
859 B
PHTML
<?php
|
|
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
|
|
|
// add warning to links that open in new tabs to improve accessibility, as recommended by WCAG20 G201
|
|
$newTabInfo = sprintf('<span class="info-box display-on-hover"> %s </span>', $this->translate('opens in new window'));
|
|
|
|
$links = MonitoredObject::parseAttributeUrls($object->action_url);
|
|
foreach ($links as $i => $link) {
|
|
$links[$i] = sprintf(
|
|
'<a href="%s" target="_blank">%s ' . $newTabInfo . '</a>',
|
|
$this->resolveMacros($object->action_url, $object),
|
|
'Action'
|
|
);
|
|
}
|
|
|
|
if (isset($this->actions)) {
|
|
foreach ($this->actions as $id => $action) {
|
|
$links[] = sprintf('<a href="%s">%s</a>', $action, $id);
|
|
}
|
|
}
|
|
|
|
if (empty($links)) {
|
|
return;
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
<th><?= $this->translate('Actions') ?></th>
|
|
<td><?= implode("\n ", $links) . "\n" ?></td>
|
|
</tr>
|