Browse Source

add tag macros

Kai Kretschmann 9 months ago
parent
commit
2de000189d
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      tpl/paginate.inc.php

+ 10
- 7
tpl/paginate.inc.php View File

@@ -1,11 +1,14 @@
1 1
 <nav>
2 2
     <ul class="pagination">
3
-<?php
3
+<?php
4
+
5
+define('TAG_ARIALABEL', '" aria-label="');
6
+
4 7
 $maxPages = ceil($state->getResultSize() / LggrState::PAGELEN); // maximum pages
5 8
 
6 9
 if ($page > 9) {
7 10
     echo '<li><a class="" href="./do.php?a=paginate&page=' . ($page - 10) .
8
-         '" aria-label="' . _('Ten left') .
11
+    TAG_ARIALABEL . _('Ten left') .
9 12
          '"><span aria-hidden="true">&lArr;</span></a></li>';
10 13
 } else {
11 14
     echo '<li class="disabled"><a href="#" aria-label="' . _('Ten left') .
@@ -14,7 +17,7 @@ if ($page > 9) {
14 17
 
15 18
 if ($page > 0) {
16 19
     echo '<li><a class="pageleft" href="./do.php?a=paginate&page=' . ($page - 1) .
17
-         '" aria-label="' . _('Previous') .
20
+    TAG_ARIALABEL . _('Previous') .
18 21
          '"><span aria-hidden="true">&laquo;</span></a></li>';
19 22
 } else {
20 23
     echo '<li class="disabled"><a href="#" aria-label="' . _('Previous') .
@@ -44,21 +47,21 @@ if ($page + 4 < $maxPages) {
44 47
 
45 48
 if ($page + 1 >= $maxPages) {
46 49
     echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 1) .
47
-         '" aria-label="' . _('Next') .
50
+    TAG_ARIALABEL . _('Next') .
48 51
          '"><span aria-hidden="true">&raquo;</span></a></li>';
49 52
 } else {
50 53
     echo '<li><a class="pageright" href="./do.php?a=paginate&page=' . ($page + 1) .
51
-         '" aria-label="' . _('Next') .
54
+    TAG_ARIALABEL . _('Next') .
52 55
          '"><span aria-hidden="true">&raquo;</span></a></li>';
53 56
 } // if
54 57
 
55 58
 if ($page + 10 >= $maxPages) {
56 59
     echo '<li class="disabled"><a href="./do.php?a=paginate&page=' . ($page + 10) .
57
-         '" aria-label="' . _('Ten right') .
60
+    TAG_ARIALABEL . _('Ten right') .
58 61
          '"><span aria-hidden="true">&rArr;</span></a></li>';
59 62
 } else {
60 63
     echo '<li><a class="pageright" href="./do.php?a=paginate&page=' .
61
-         ($page + 10) . '" aria-label="' . _('Ten right') .
64
+        ($page + 10) . TAG_ARIALABEL . _('Ten right') .
62 65
          '"><span aria-hidden="true">&rArr;</span></a></li>';
63 66
 } // if
64 67
 

Loading…
Cancel
Save
Social stuff:
Mastodon