From 230c65478f1b0c40036c5fcf4c69f98e8059fb84 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 20 Nov 2023 22:22:21 +0100 Subject: [PATCH] PageIndexWidget: restore wildcard functionality --- public/css/default.css | 3 +++ templates/PageIndexWidget.php | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/public/css/default.css b/public/css/default.css index e081584..c13704b 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -75,6 +75,9 @@ a:hover { .pagination .page-item { box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3); } +.pagination .wildcard { + cursor: pointer; +} @media (max-width: 767px) { .pagination { diff --git a/templates/PageIndexWidget.php b/templates/PageIndexWidget.php index 8e00490..c20baac 100644 --- a/templates/PageIndexWidget.php +++ b/templates/PageIndexWidget.php @@ -11,6 +11,8 @@ class PageIndexWidget extends Template private $index; private string $class; + private static $unique_index_count = 0; + public function __construct(PageIndex $index) { $this->index = $index; @@ -37,14 +39,18 @@ class PageIndexWidget extends Template '', '« previous'; + $num_wildcards = 0; foreach ($page_index as $key => $page) { if (!is_numeric($key)) continue; if (!is_array($page)) + { + $num_wildcards++; echo ' -
  • ...
  • '; +
  • ...
  • '; + } else echo '
  • ', @@ -56,5 +62,17 @@ class PageIndexWidget extends Template '', 'next »
  • '; + + if ($num_wildcards) + { + echo ' + '; + } } }