pagination.phtml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $url_next = Minz_Request::currentRequest();
  4. $url_next['params']['next'] = FreshRSS_Context::$next_id;
  5. $url_next['params']['state'] = FreshRSS_Context::$state;
  6. $url_next['params']['ajax'] = 1;
  7. $url_mark_read = array(
  8. 'c' => 'entry',
  9. 'a' => 'read',
  10. 'params' => array(
  11. 'get' => FreshRSS_Context::currentGet(),
  12. 'nextGet' => FreshRSS_Context::$next_get,
  13. 'idMax' => FreshRSS_Context::$id_max,
  14. 'search' => htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES),
  15. 'state' => FreshRSS_Context::$state,
  16. )
  17. );
  18. ?>
  19. <?php
  20. $hasAccess = FreshRSS_Auth::hasAccess();
  21. if ($hasAccess) { ?>
  22. <form id="mark-read-pagination" method="post">
  23. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  24. <?php } else { ?>
  25. <div id="mark-read-pagination">
  26. <?php }?>
  27. <ul class="pagination">
  28. <li class="item pager-next">
  29. <?php if (FreshRSS_Context::$next_id) { ?>
  30. <a id="load_more" href="<?= Minz_Url::display($url_next) ?>">
  31. <?= _t('gen.pagination.load_more') ?>
  32. </a>
  33. <?php } elseif ($hasAccess) { ?>
  34. <button id="bigMarkAsRead"
  35. class="as-link <?= FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
  36. form="mark-read-pagination"
  37. formaction="<?= Minz_Url::display($url_mark_read) ?>"
  38. type="submit">
  39. <?= _t('gen.pagination.nothing_to_load') ?><br />
  40. <span class="bigTick">✓</span><br />
  41. <?= _t('gen.pagination.mark_all_read') ?>
  42. </button>
  43. <?php } else { ?>
  44. <div id="bigMarkAsRead">
  45. <?= _t('gen.pagination.nothing_to_load') ?><br />
  46. </div>
  47. <?php } ?>
  48. </li>
  49. </ul>
  50. <?php if ($hasAccess) { ?>
  51. </form>
  52. <?php } else {?>
  53. </div>
  54. <?php }?>