logs_pagination.phtml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $c = Minz_Request::controllerName();
  4. $a = Minz_Request::actionName();
  5. $params = $_GET;
  6. ?>
  7. <?php if ($this->nbPage > 1) { ?>
  8. <nav class="nav-pagination nav-list">
  9. <ul class="pagination">
  10. <?php
  11. /** @var int $getteur */
  12. $params[$getteur] = 1;
  13. ?>
  14. <li class="item pager-first">
  15. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('conf.logs.pagination.first') ?></a>
  16. </li>
  17. <?php $params[$getteur] = $this->currentPage - 1; ?>
  18. <li class="item pager-previous">
  19. <?php if ($this->currentPage > 1) { ?>
  20. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
  21. <?php } ?>
  22. </li>
  23. <?php if ($this->currentPage - 2 > 1) { ?>
  24. <li class="item">…</a></li>
  25. <?php } ?>
  26. <?php
  27. for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) {
  28. if($i > 0 && $i <= $this->nbPage) {
  29. $params[$getteur] = $i;
  30. if ($i != $this->currentPage) {
  31. $class = '';
  32. $aria = 'false';
  33. } else {
  34. $class = ' active';
  35. $aria = 'true';
  36. } ?>
  37. <li class="item<?= $class ?>"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>" aria-current="<?= $aria ?>"><?= $i ?></a></li>
  38. <?php
  39. }
  40. } ?>
  41. <?php if ($this->nbPage > $i - 1) { ?>
  42. <li class="item">…</a></li>
  43. <?php } ?>
  44. <?php $params[$getteur] = $this->currentPage + 1; ?>
  45. <li class="item pager-next">
  46. <?php if ($this->currentPage < $this->nbPage) { ?>
  47. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
  48. <?php } ?>
  49. </li>
  50. <?php $params[$getteur] = $this->nbPage; ?>
  51. <li class="item pager-last">
  52. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.last') ?> »</a>
  53. </li>
  54. </ul>
  55. </nav>
  56. <?php } ?>