logs_pagination.phtml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. <ul class="pagination">
  9. <?php
  10. /** @var int $getteur */
  11. $params[$getteur] = 1;
  12. ?>
  13. <li class="item pager-first">
  14. <?php if ($this->currentPage > 1) { ?>
  15. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _t('gen.pagination.first') ?></a>
  16. <?php } ?>
  17. </li>
  18. <?php $params[$getteur] = $this->currentPage - 1; ?>
  19. <li class="item pager-previous">
  20. <?php if ($this->currentPage > 1) { ?>
  21. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('gen.pagination.previous') ?></a>
  22. <?php } ?>
  23. </li>
  24. <?php for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) { ?>
  25. <?php if($i > 0 && $i <= $this->nbPage) { ?>
  26. <?php if ($i != $this->currentPage) { ?>
  27. <?php $params[$getteur] = $i; ?>
  28. <li class="item pager-item"><a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= $i ?></a></li>
  29. <?php } else { ?>
  30. <li class="item pager-current"><?= $i ?></li>
  31. <?php } ?>
  32. <?php } ?>
  33. <?php } ?>
  34. <?php $params[$getteur] = $this->currentPage + 1; ?>
  35. <li class="item pager-next">
  36. <?php if ($this->currentPage < $this->nbPage) { ?>
  37. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('gen.pagination.next') ?> ›</a>
  38. <?php } ?>
  39. </li>
  40. <?php $params[$getteur] = $this->nbPage; ?>
  41. <li class="item pager-last">
  42. <?php if ($this->currentPage < $this->nbPage) { ?>
  43. <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('gen.pagination.last') ?> »</a>
  44. <?php } ?>
  45. </li>
  46. </ul>
  47. <?php } ?>