icingaweb2/modules/monitoring/application/views/scripts/show/components/actions.phtml

31 lines
859 B
PHTML
Raw Normal View History

<?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'
);
}
2015-05-18 11:45:39 +02:00
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>