summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/pivottablePagination.phtml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:39:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:39:39 +0000
commit8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch)
tree2492de6f1528dd44eaa169a5c1555026d9cb75ec /application/views/scripts/pivottablePagination.phtml
parentInitial commit. (diff)
downloadicingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.tar.xz
icingaweb2-8ca6cc32b2c789a3149861159ad258f2cb9491e3.zip
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/views/scripts/pivottablePagination.phtml')
-rw-r--r--application/views/scripts/pivottablePagination.phtml48
1 files changed, 48 insertions, 0 deletions
diff --git a/application/views/scripts/pivottablePagination.phtml b/application/views/scripts/pivottablePagination.phtml
new file mode 100644
index 0000000..ce18014
--- /dev/null
+++ b/application/views/scripts/pivottablePagination.phtml
@@ -0,0 +1,48 @@
+<?php
+
+use Icinga\Web\Url;
+
+if ($xAxisPaginator->count() <= 1 && $yAxisPaginator->count() <= 1) {
+ return; // Display this pagination only if there are multiple pages
+}
+
+$fromTo = t('%s: %d to %d of %d (on the %s-axis)');
+$xAxisPages = $xAxisPaginator->getPages('all');
+$yAxisPages = $yAxisPaginator->getPages('all');
+
+?>
+
+<div class="pivot-pagination">
+ <span><?= t('Navigation'); ?></span>
+ <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)
+ )->getAbsoluteUrl(); ?>" title="<?= sprintf(
+ $fromTo,
+ t('Hosts'),
+ ($yAxisPage - 1) * $yAxisPages->itemCountPerPage + 1,
+ $yAxisPage === $yAxisPages->last ? $yAxisPages->totalItemCount : $yAxisPage * $yAxisPages->itemCountPerPage,
+ $yAxisPages->totalItemCount,
+ 'y'
+ ) . '; ' . sprintf(
+ $fromTo,
+ t('Services'),
+ ($xAxisPage - 1) * $xAxisPages->itemCountPerPage + 1,
+ $xAxisPage === $xAxisPages->last ? $xAxisPages->totalItemCount : $xAxisPage * $xAxisPages->itemCountPerPage,
+ $xAxisPages->totalItemCount,
+ 'x'
+ ); ?>"></a>
+<?php endif ?>
+ </td>
+<?php endforeach ?>
+ </tr>
+<?php endforeach ?>
+ </tbody>
+ </table>
+</div>