2014-03-14 15:49:47 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Icinga\Web\Url;
|
|
|
|
|
|
|
|
if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) {
|
|
|
|
return; // Display this pagination only if there are multiple pages
|
|
|
|
}
|
|
|
|
|
2014-12-19 17:15:14 +01:00
|
|
|
$fromTo = t('%s: %d to %d of %d (on the %s-axis)');
|
2014-03-14 15:49:47 +01:00
|
|
|
$xAxisPages = $xAxisPaginator->getPages('all');
|
|
|
|
$yAxisPages = $yAxisPaginator->getPages('all');
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="pivot-pagination">
|
2014-05-28 00:15:19 +02:00
|
|
|
<span><?= t('Navigation'); ?></span>
|
2014-03-14 15:49:47 +01:00
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($yAxisPages->pagesInRange as $yAxisPage): ?>
|
|
|
|
<tr>
|
|
|
|
<?php foreach ($xAxisPages->pagesInRange as $xAxisPage): ?>
|
|
|
|
<td<?= $xAxisPage === $xAxisPages->current && $yAxisPage === $yAxisPages->current ? ' class="active"' : ''; ?>>
|
|
|
|
<?php if ($xAxisPage !== $xAxisPages->current || $yAxisPage !== $yAxisPages->current): ?>
|
|
|
|
<a href="<?= Url::fromRequest()->overwriteParams(
|
|
|
|
array('page' => $xAxisPage . ',' . $yAxisPage)
|
2014-03-19 09:10:39 +01:00
|
|
|
)->getAbsoluteUrl(); ?>" title="<?= sprintf(
|
|
|
|
$fromTo,
|
2014-05-28 00:15:19 +02:00
|
|
|
t('Hosts'),
|
2014-03-19 09:10:39 +01:00
|
|
|
($yAxisPage - 1) * $yAxisPages->itemCountPerPage + 1,
|
|
|
|
$yAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $yAxisPage * $yAxisPages->itemCountPerPage,
|
2014-12-19 17:15:14 +01:00
|
|
|
$yAxisPages->totalItemCount,
|
|
|
|
'y'
|
2014-03-19 09:10:39 +01:00
|
|
|
) . '; ' . sprintf(
|
|
|
|
$fromTo,
|
2014-05-28 00:15:19 +02:00
|
|
|
t('Services'),
|
2014-03-19 09:10:39 +01:00
|
|
|
($xAxisPage - 1) * $xAxisPages->itemCountPerPage + 1,
|
|
|
|
$xAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $xAxisPage * $xAxisPages->itemCountPerPage,
|
2014-12-19 17:15:14 +01:00
|
|
|
$xAxisPages->totalItemCount,
|
|
|
|
'x'
|
2014-03-19 09:10:39 +01:00
|
|
|
); ?>"></a>
|
2014-03-14 15:49:47 +01:00
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|