Do only escape a qlink's label manually if necessary

This commit is contained in:
Johannes Meyer 2015-02-24 11:35:25 +01:00
parent 907134cee2
commit 8e8bab0795
17 changed files with 155 additions and 143 deletions

View File

@ -26,21 +26,25 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($name), $name,
'config/editresource', 'config/editresource',
array('resource' => $name), array('resource' => $name),
array('title' => sprintf($this->translate('Edit resource %s'), $name)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
); ?> ); ?>
</td> </td>
<td> <td>
<center> <center>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'config/removeresource', 'config/removeresource',
array('resource' => $name), array('resource' => $name),
array('title' => sprintf($this->translate('Remove resource %s'), $name)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
); ?> ); ?>
</center> </center>
</td> </td>

View File

@ -24,11 +24,13 @@
</th> </th>
<th> <th>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'dashboard/remove-pane', 'dashboard/remove-pane',
array('pane' => $pane->getName()), array('pane' => $pane->getName()),
array('title' => sprintf($this->translate('Remove pane %s'), $pane->getName())), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove pane %s'), $pane->getName())
)
); ?> ); ?>
</th> </th>
</tr> </tr>
@ -61,11 +63,13 @@
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'dashboard/remove-dashlet', 'dashboard/remove-dashlet',
array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()), array('pane' => $pane->getName(), 'dashlet' => $dashlet->getTitle()),
array('title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove dashlet %s from pane %s'), $dashlet->getTitle(), $pane->getName())
)
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -11,20 +11,24 @@
<tr> <tr>
<td class="action"> <td class="action">
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendNames[$i]), $backendNames[$i],
'config/editAuthenticationBackend', 'config/editAuthenticationBackend',
array('auth_backend' => $backendNames[$i]), array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit authentication backend %s'), $backendNames[$i])
)
); ?> ); ?>
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'config/removeAuthenticationBackend', 'config/removeAuthenticationBackend',
array('auth_backend' => $backendNames[$i]), array('auth_backend' => $backendNames[$i]),
array('title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove authentication backend %s'), $backendNames[$i])
)
); ?> ); ?>
</td> </td>
<td> <td>

View File

@ -29,12 +29,13 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td> <td>
<?php if ($prevYAxisPage): ?> <?php if ($prevYAxisPage): ?>
<?= $this->qlink( <?= $this->qlink(
$this->icon('up-open'), '',
Url::fromRequest(), Url::fromRequest(),
array( array(
'page' => $currentXAxisPage . ',' . $prevYAxisPage 'page' => $currentXAxisPage . ',' . $prevYAxisPage
), ),
array( array(
'icon' => 'up-open',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => sprintf( 'title' => sprintf(
$showText, $showText,
@ -44,8 +45,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$prevYAxisPage * $yAxisPages->itemCountPerPage, $prevYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount $yAxisPages->totalItemCount
) )
), )
false
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('up-open'); ?> <?= $this->icon('up-open'); ?>
@ -57,12 +57,13 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td> <td>
<?php if ($prevXAxisPage): ?> <?php if ($prevXAxisPage): ?>
<?= $this->qlink( <?= $this->qlink(
$this->icon('left-open'), '',
Url::fromRequest(), Url::fromRequest(),
array( array(
'page' => $prevXAxisPage . ',' . $currentYAxisPage 'page' => $prevXAxisPage . ',' . $currentYAxisPage
), ),
array( array(
'icon' => 'left-open',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => sprintf( 'title' => sprintf(
$showText, $showText,
@ -72,8 +73,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$prevXAxisPage * $xAxisPages->itemCountPerPage, $prevXAxisPage * $xAxisPages->itemCountPerPage,
$xAxisPages->totalItemCount $xAxisPages->totalItemCount
) )
), )
false
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('left-open'); ?> <?= $this->icon('left-open'); ?>
@ -83,12 +83,13 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td> <td>
<?php if ($nextXAxisPage): ?> <?php if ($nextXAxisPage): ?>
<?= $this->qlink( <?= $this->qlink(
$this->icon('right-open'), '',
Url::fromRequest(), Url::fromRequest(),
array( array(
'page' => $nextXAxisPage . ',' . $currentYAxisPage 'page' => $nextXAxisPage . ',' . $currentYAxisPage
), ),
array( array(
'icon' => 'right-open',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => sprintf( 'title' => sprintf(
$showText, $showText,
@ -111,12 +112,13 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
<td> <td>
<?php if ($nextYAxisPage): ?> <?php if ($nextYAxisPage): ?>
<?= $this->qlink( <?= $this->qlink(
$this->icon('down-open'), '',
Url::fromRequest(), Url::fromRequest(),
array( array(
'page' => $currentXAxisPage . ',' . $nextYAxisPage 'page' => $currentXAxisPage . ',' . $nextYAxisPage
), ),
array( array(
'icon' => 'down-open',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => sprintf( 'title' => sprintf(
$showText, $showText,
@ -126,8 +128,7 @@ $nextXAxisPage = $currentXAxisPage < $totalXAxisPages ? $currentXAxisPage + 1 :
$nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage, $nextYAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $nextYAxisPage * $yAxisPages->itemCountPerPage,
$yAxisPages->totalItemCount $yAxisPages->totalItemCount
) )
), )
false
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('down-open'); ?> <?= $this->icon('down-open'); ?>

View File

@ -56,11 +56,13 @@
<td><?= $this->escape($role->groups) ?></td> <td><?= $this->escape($role->groups) ?></td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'roles/remove', 'roles/remove',
array('role' => $name), array('role' => $name),
array('title' => sprintf($this->translate('Remove role %s'), $name)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove role %s'), $name)
)
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -28,15 +28,23 @@ $this->addHelperFunction('url', function ($path = null, $params = null) {
}); });
$this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = null, $escape = true) use ($view) { $this->addHelperFunction('qlink', function ($title, $url, $params = null, $properties = null, $escape = true) use ($view) {
if ($properties && array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) { $icon = '';
$properties['aria-label'] = $properties['title']; if ($properties) {
if (array_key_exists('title', $properties) && !array_key_exists('aria-label', $properties)) {
$properties['aria-label'] = $properties['title'];
}
if (array_key_exists('icon', $properties)) {
$icon = $view->icon($properties['icon']);
unset($properties['icon']);
}
} }
return sprintf( return sprintf(
'<a href="%s"%s>%s</a>', '<a href="%s"%s>%s</a>',
$view->url($url, $params), $view->url($url, $params),
$view->propertiesToString($properties), $view->propertiesToString($properties),
$escape ? $view->escape($title) : $title $icon . ($escape ? $view->escape($title) : $title)
); );
}); });

View File

@ -310,8 +310,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('removeFilter', $filter->getId()), $this->preservedUrl()->with('removeFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Remove this part of your filter'), 'icon' => 'icon-cancel',
'class' => 'icon-cancel' 'title' => t('Remove this part of your filter')
) )
); );
} }
@ -323,8 +323,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('addFilter', $filter->getId()), $this->preservedUrl()->with('addFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Add another filter'), 'icon' => 'icon-plus',
'class' => 'icon-plus' 'title' => t('Add another filter')
) )
); );
} }
@ -336,8 +336,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->with('stripFilter', $filter->getId()), $this->preservedUrl()->with('stripFilter', $filter->getId()),
null, null,
array( array(
'title' => t('Strip this filter'), 'icon' => 'icon-minus',
'class' => 'icon-minus' 'title' => t('Strip this filter')
) )
); );
} }
@ -349,8 +349,8 @@ class FilterEditor extends AbstractWidget
$this->preservedUrl()->without('addFilter'), $this->preservedUrl()->without('addFilter'),
null, null,
array( array(
'title' => t('Cancel this operation'), 'icon' => 'icon-cancel',
'class' => 'icon-cancel' 'title' => t('Cancel this operation')
) )
); );
} }

View File

@ -19,11 +19,13 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($backendName), $backendName,
'/monitoring/config/editbackend', '/monitoring/config/editbackend',
array('backend' => $backendName), array('backend' => $backendName),
array('title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
)
); ?> ); ?>
<small>(<?= sprintf( <small>(<?= sprintf(
$this->translate('Type: %s'), $this->translate('Type: %s'),
@ -32,11 +34,13 @@
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'/monitoring/config/removebackend', '/monitoring/config/removebackend',
array('backend' => $backendName), array('backend' => $backendName),
array('title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName)
)
); ?> ); ?>
</td> </td>
</tr> </tr>
@ -59,11 +63,13 @@
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('edit') . ' ' . $this->escape($instanceName), $instanceName,
'/monitoring/config/editinstance', '/monitoring/config/editinstance',
array('instance' => $instanceName), array('instance' => $instanceName),
array('title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)), array(
false 'icon' => 'edit',
'title' => sprintf($this->translate('Edit monitoring instance %s'), $instanceName)
)
); ?> ); ?>
<small>(<?= sprintf( <small>(<?= sprintf(
$this->translate('Type: %s'), $this->translate('Type: %s'),
@ -72,11 +78,13 @@
</td> </td>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$this->icon('cancel'), '',
'/monitoring/config/removeinstance', '/monitoring/config/removeinstance',
array('instance' => $instanceName), array('instance' => $instanceName),
array('title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)), array(
false 'icon' => 'cancel',
'title' => sprintf($this->translate('Remove monitoring instance %s'), $instanceName)
)
); ?> ); ?>
</td> </td>
</tr> </tr>

View File

@ -14,31 +14,22 @@
<?= $checkNowForm; ?> <?= $checkNowForm; ?>
</div> </div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('reschedule') . ' ' . sprintf( sprintf($this->translate('Reschedule the next check for all %u hosts'), $hostCount),
$this->translate('Reschedule the next check for all %u hosts'),
$hostCount
),
$rescheduleAllLink, $rescheduleAllLink,
null, null,
null, array('icon' => 'reschedule')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf($this->translate('Schedule a downtime for all %u hosts'), $hostCount), sprintf($this->translate('Schedule a downtime for all %u hosts'), $hostCount),
$downtimeAllLink, $downtimeAllLink,
null, null,
null, array('icon' => 'plug')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('reply') . ' ' . sprintf( sprintf($this->translate('Submit a passive check result for all %u hosts'), $hostCount),
$this->translate('Submit a passive check result for all %u hosts'),
$hostCount
),
$processCheckResultAllLink, $processCheckResultAllLink,
null, null,
null, array('icon' => 'reply')
false
); ?></div> ); ?></div>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?> <?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div> <div>
@ -51,7 +42,7 @@
$unhandledCount $unhandledCount
); ?></h3> ); ?></h3>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'Schedule a downtime for %u unhandled host problem', 'Schedule a downtime for %u unhandled host problem',
'Schedule a downtime for %u unhandled host problems', 'Schedule a downtime for %u unhandled host problems',
@ -61,11 +52,10 @@
), ),
$downtimeUnhandledLink, $downtimeUnhandledLink,
null, null,
null, array('icon' => 'plug')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('ok') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'Acknowledge %u unhandled host problem', 'Acknowledge %u unhandled host problem',
'Acknowledge %u unhandled host problems', 'Acknowledge %u unhandled host problems',
@ -75,8 +65,7 @@
), ),
$acknowledgeUnhandledLink, $acknowledgeUnhandledLink,
null, null,
null, array('icon' => 'ok')
false
); ?></div> ); ?></div>
</div> </div>
<?php endif ?> <?php endif ?>
@ -95,7 +84,7 @@
<?php endif ?> <?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?> <?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<h2><?= $this->qlink( <h2><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'List %u host currently in downtime', 'List %u host currently in downtime',
'List %u hosts currently in downtime', 'List %u hosts currently in downtime',
@ -105,13 +94,12 @@
), ),
$inDowntimeLink, $inDowntimeLink,
null, null,
null, array('icon' => 'plug')
false
); ?></h2> ); ?></h2>
<?php endif ?> <?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?> <?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h2><?= $this->qlink( <h2><?= $this->qlink(
$this->icon('comment') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'List %u host comment', 'List %u host comment',
'List %u host comments', 'List %u host comments',
@ -121,8 +109,7 @@
), ),
$commentsLink, $commentsLink,
null, null,
null, array('icon' => 'comment')
false
); ?></h2> ); ?></h2>
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>

View File

@ -17,16 +17,15 @@
foreach ($contacts as $contact): ?> foreach ($contacts as $contact): ?>
<div class="contact"> <div class="contact">
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?> <?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<?= $this->qlink( <strong><?= $this->qlink(
'<strong>' . $this->escape($contact->contact_name) . '</strong>', $contact->contact_name,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact->contact_name), array('contact' => $contact->contact_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('Show detailed information about %s'), $this->translate('Show detailed information about %s'),
$contact->contact_alias $contact->contact_alias
)), ))
false ); ?></strong> (<?= $contact->contact_alias; ?>)
); ?> (<?= $contact->contact_alias; ?>)
<div> <div>
<?= $this->translate('Email'); ?>: <a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>"> <?= $this->translate('Email'); ?>: <a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
<?= $this->escape($contact->contact_email); ?> <?= $this->escape($contact->contact_email); ?>

View File

@ -14,31 +14,22 @@
<?= $checkNowForm; ?> <?= $checkNowForm; ?>
</div> </div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('reschedule') . ' ' . sprintf( sprintf($this->translate('Reschedule the next check for all %u services'), $serviceCount),
$this->translate('Reschedule the next check for all %u services'),
$serviceCount
),
$rescheduleAllLink, $rescheduleAllLink,
null, null,
null, array('icon' => 'reschedule')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf($this->translate('Schedule a downtime for all %u services'), $serviceCount), sprintf($this->translate('Schedule a downtime for all %u services'), $serviceCount),
$downtimeAllLink, $downtimeAllLink,
null, null,
null, array('icon' => 'plug')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('reply') . ' ' . sprintf( sprintf($this->translate('Submit a passive check result for all %u services'), $serviceCount),
$this->translate('Submit a passive check result for all %u services'),
$serviceCount
),
$processCheckResultAllLink, $processCheckResultAllLink,
null, null,
null, array('icon' => 'reply')
false
); ?></div> ); ?></div>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?> <?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div> <div>
@ -51,7 +42,7 @@
$unhandledCount $unhandledCount
); ?></h3> ); ?></h3>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'Schedule a downtime for %u unhandled service problem', 'Schedule a downtime for %u unhandled service problem',
'Schedule a downtime for %u unhandled service problems', 'Schedule a downtime for %u unhandled service problems',
@ -61,11 +52,10 @@
), ),
$downtimeUnhandledLink, $downtimeUnhandledLink,
null, null,
null, array('icon' => 'plug')
false
); ?></div> ); ?></div>
<div><?= $this->qlink( <div><?= $this->qlink(
$this->icon('ok') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'Acknowledge %u unhandled service problem', 'Acknowledge %u unhandled service problem',
'Acknowledge %u unhandled service problems', 'Acknowledge %u unhandled service problems',
@ -75,8 +65,7 @@
), ),
$acknowledgeUnhandledLink, $acknowledgeUnhandledLink,
null, null,
null, array('icon' => 'ok')
false
); ?></div> ); ?></div>
</div> </div>
<?php endif ?> <?php endif ?>
@ -95,7 +84,7 @@
<?php endif ?> <?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?> <?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<h2><?= $this->qlink( <h2><?= $this->qlink(
$this->icon('plug') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'List %u service currently in downtime', 'List %u service currently in downtime',
'List %u services currently in downtime', 'List %u services currently in downtime',
@ -105,13 +94,12 @@
), ),
$inDowntimeLink, $inDowntimeLink,
null, null,
null, array('icon' => 'plug')
false
); ?></h2> ); ?></h2>
<?php endif ?> <?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?> <?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h2><?= $this->qlink( <h2><?= $this->qlink(
$this->icon('comment') . ' ' . sprintf( sprintf(
$this->translatePlural( $this->translatePlural(
'List %u service comment', 'List %u service comment',
'List %u service comments', 'List %u service comments',
@ -121,8 +109,7 @@
), ),
$commentsLink, $commentsLink,
null, null,
null, array('icon' => 'comment')
false
); ?></h2> ); ?></h2>
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>

View File

@ -36,13 +36,15 @@ if ($object->acknowledged): ?>
} }
?> ?>
<?= $this->qlink( <?= $this->qlink(
$this->icon('ok') . ' ' . $this->translate('Acknowledge'), $this->translate('Acknowledge'),
$ackLink, $ackLink,
null, null,
array('title' => $this->translate( array(
'Acknowledge this problem, suppress all future notifications for it and tag it as being handled' 'icon' => 'ok',
)), 'title' => $this->translate(
false 'Acknowledge this problem, suppress all future notifications for it and tag it as being handled'
)
)
); ?> ); ?>
<?php } else { <?php } else {
echo '&#45;'; echo '&#45;';

View File

@ -29,29 +29,29 @@ if ($object->getType() === $object::TYPE_HOST) {
<?php if ($this->hasPermission('monitoring/command/schedule-check')) { <?php if ($this->hasPermission('monitoring/command/schedule-check')) {
if ($isService) { if ($isService) {
echo $this->qlink( echo $this->qlink(
$this->icon('reschedule') . ' ' . $this->translate('Reschedule'), $this->translate('Reschedule'),
'monitoring/service/reschedule-check', 'monitoring/service/reschedule-check',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array( array(
'icon' => 'reschedule',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate( 'title' => $this->translate(
'Schedule the next active check at a different time than the current one' 'Schedule the next active check at a different time than the current one'
) )
), )
false
); );
} else { } else {
echo $this->qlink( echo $this->qlink(
$this->icon('reschedule') . ' ' . $this->translate('Reschedule'), $this->translate('Reschedule'),
'monitoring/host/reschedule-check', 'monitoring/host/reschedule-check',
array('host' => $object->getName()), array('host' => $object->getName()),
array( array(
'icon' => 'reschedule',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate( 'title' => $this->translate(
'Schedule the next active check at a different time than the current one' 'Schedule the next active check at a different time than the current one'
) )
), )
false
); );
} }
} ?> <?= $this->timeUntil($object->next_check) ?> } ?> <?= $this->timeUntil($object->next_check) ?>

View File

@ -13,19 +13,25 @@ $command = array_shift($parts);
$title = sprintf($this->translate('Submit a one time or so called passive result for the %s check'), $command); $title = sprintf($this->translate('Submit a one time or so called passive result for the %s check'), $command);
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink( echo $this->qlink(
$this->icon('reply') . ' ' . $this->translate('Process check result'), $this->translate('Process check result'),
'monitoring/host/process-check-result', 'monitoring/host/process-check-result',
array('host' => $object->getName()), array('host' => $object->getName()),
array('data-base-target' => '_self', 'title' => $title), array(
false 'icon' => 'reply',
'data-base-target' => '_self',
'title' => $title
)
); );
} else { } else {
echo $this->qlink( echo $this->qlink(
$this->icon('reply') . ' ' . $this->translate('Process check result'), $this->translate('Process check result'),
'monitoring/service/process-check-result', 'monitoring/service/process-check-result',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array('data-base-target' => '_self', 'title' => $title), array(
false 'icon' => 'reply',
'data-base-target' => '_self',
'title' => $title
)
); );
} }
} ?> } ?>

View File

@ -5,25 +5,25 @@
/** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink( echo $this->qlink(
$this->icon('comment') . ' ' . $this->translate('Add comment'), $this->translate('Add comment'),
'monitoring/host/add-comment', 'monitoring/host/add-comment',
array('host' => $object->getName()), array('host' => $object->getName()),
array( array(
'icon' => 'comment',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this host') 'title' => $this->translate('Add a new comment to this host')
), )
false
); );
} else { } else {
echo $this->qlink( echo $this->qlink(
$this->icon('comment') . ' ' . $this->translate('Add comment'), $this->translate('Add comment'),
'monitoring/service/add-comment', 'monitoring/service/add-comment',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array( array(
'icon' => 'comment',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate('Add a new comment to this service') 'title' => $this->translate('Add a new comment to this service')
), )
false
); );
} }
} else { } else {

View File

@ -5,29 +5,29 @@
/** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink( echo $this->qlink(
$this->icon('plug') . ' ' . $this->translate('Schedule downtime'), $this->translate('Schedule downtime'),
'monitoring/host/schedule-downtime', 'monitoring/host/schedule-downtime',
array('host' => $object->getName()), array('host' => $object->getName()),
array( array(
'icon' => 'plug',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate( 'title' => $this->translate(
'Schedule a downtime to suppress all problem notifications within a specific period of time' 'Schedule a downtime to suppress all problem notifications within a specific period of time'
) )
), )
false
); );
} else { } else {
echo $this->qlink( echo $this->qlink(
$this->icon('plug') . ' ' . $this->translate('Schedule downtime'), $this->translate('Schedule downtime'),
'monitoring/service/schedule-downtime', 'monitoring/service/schedule-downtime',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
array( array(
'icon' => 'plug',
'data-base-target' => '_self', 'data-base-target' => '_self',
'title' => $this->translate( 'title' => $this->translate(
'Schedule a downtime to suppress all problem notifications within a specific period of time' 'Schedule a downtime to suppress all problem notifications within a specific period of time'
) )
), )
false
); );
} }
} else { } else {

View File

@ -141,7 +141,7 @@ $output = $this->tickets ? preg_replace_callback(
<?= sprintf( <?= sprintf(
$this->translate('%s on %s', 'Service running on host'), $this->translate('%s on %s', 'Service running on host'),
$hostContext ? $this->qlink( $hostContext ? $this->qlink(
$this->escape($event->service_display_name), $event->service_display_name,
'monitoring/show/service', 'monitoring/show/service',
array( array(
'host' => $event->host_name, 'host' => $event->host_name,