logs_pagination.phtml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('conf.logs.pagination.previous') ?></a>
  20. </li>
  21. <?php if ($this->currentPage - 2 > 1) { ?>
  22. <li class="item">…</a></li>
  23. <?php } ?>
  24. <?php
  25. for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) {
  26. if($i > 0 && $i <= $this->nbPage) {
  27. if ($i != $this->currentPage) {
  28. $params[$getteur] = $i;
  29. $class = '';
  30. $aria = 'false';
  31. } else {
  32. $class = ' active';
  33. $aria = 'true';
  34. } ?>
  35. <li class="item<?= $class ?>"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>" aria-current="<?= $aria ?>"><?= $i ?></a></li>
  36. <?php
  37. }
  38. } ?>
  39. <?php if ($this->nbPage > $i - 1) { ?>
  40. <li class="item">…</a></li>
  41. <?php } ?>
  42. <?php $params[$getteur] = $this->currentPage + 1; ?>
  43. <li class="item pager-next">
  44. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a>
  45. </li>
  46. <?php $params[$getteur] = $this->nbPage; ?>
  47. <li class="item pager-last">
  48. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('conf.logs.pagination.last') ?> »</a>
  49. </li>
  50. </ul>
  51. </nav>
  52. <?php } ?>