2014-03-08 19:49:57 +01:00
|
|
|
<?php
|
2015-03-16 17:38:07 +01:00
|
|
|
|
2015-09-07 09:53:53 +02:00
|
|
|
use Icinga\Web\Navigation\Navigation;
|
|
|
|
|
|
|
|
$navigation = new Navigation();
|
|
|
|
|
2015-03-16 17:38:07 +01:00
|
|
|
// 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'));
|
|
|
|
|
2015-09-07 09:53:53 +02:00
|
|
|
foreach ($object->getActionUrls() as $i => $link) {
|
|
|
|
$navigation->addItem(
|
|
|
|
'Action ' . ($i + 1) . $newTabInfo,
|
|
|
|
array(
|
|
|
|
'url' => $link,
|
|
|
|
'target' => '_blank'
|
|
|
|
)
|
|
|
|
);
|
2014-03-08 19:49:57 +01:00
|
|
|
}
|
|
|
|
|
2015-05-18 11:45:39 +02:00
|
|
|
if (isset($this->actions)) {
|
|
|
|
foreach ($this->actions as $id => $action) {
|
2015-09-07 09:53:53 +02:00
|
|
|
$navigation->addItem($id, array('url' => $action));
|
2015-01-14 11:02:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-07 09:53:53 +02:00
|
|
|
if ($navigation->isEmpty()) {
|
2015-01-14 11:50:03 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-03-08 19:49:57 +01:00
|
|
|
?>
|
|
|
|
<tr>
|
2015-09-07 09:53:53 +02:00
|
|
|
<th><?= $this->translate('Actions'); ?></th>
|
|
|
|
<?= $navigation->getRenderer()->setElementTag('td'); ?>
|
|
|
|
</tr>
|