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

27 lines
893 B
PHTML

<?php
$notes = trim($object->getNotes());
$links = $object->getNotesUrls();
if (! empty($links) || ! empty($notes)): ?>
<tr>
<th><?= $this->translate('Notes') ?></th>
<td>
<?php
if (! empty($notes)) {
echo $notes . '<br>';
}
// 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')
);
$linkText = '<a href="%s" target="_blank">%s ' . $newTabInfo . '</a>';
foreach ($links as $i => $link) {
$links[$i] = sprintf($linkText, $this->escape($link), $this->escape($link));
}
echo implode('<br>', $links);
?>
</td>
</tr>
<?php endif ?>