stream-footer.phtml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. $url_next = Minz_Request::currentRequest();
  5. if (FreshRSS_Context::$continuation_id !== '0') {
  6. $url_next['params']['cid'] = FreshRSS_Context::$continuation_id;
  7. }
  8. if (FreshRSS_Context::$sort !== 'id') {
  9. $url_next['params']['idMax'] = FreshRSS_Context::$id_max;
  10. }
  11. $url_next['params']['state'] = (string)FreshRSS_Context::$state;
  12. $url_next['params']['ajax'] = '1';
  13. $url_mark_read = [
  14. 'c' => 'entry',
  15. 'a' => 'read',
  16. 'params' => [
  17. 'get' => FreshRSS_Context::currentGet(),
  18. 'nextGet' => FreshRSS_Context::$next_get,
  19. 'idMax' => FreshRSS_Context::$id_max,
  20. 'search' => FreshRSS_Context::$search->toString(),
  21. 'state' => FreshRSS_Context::$state,
  22. 'sort' => FreshRSS_Context::$sort,
  23. 'order' => FreshRSS_Context::$order,
  24. ],
  25. ];
  26. $hasAccess = FreshRSS_Auth::hasAccess();
  27. if ($hasAccess) {
  28. ?>
  29. <form id="stream-footer" action="" method="post">
  30. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  31. <?php } else { ?>
  32. <div id="stream-footer">
  33. <?php }?>
  34. <div class="stream-footer-inner">
  35. <?php if (FreshRSS_Context::$continuation_id !== '0') { ?>
  36. <button id="load_more" type="submit" class="btn" formaction="<?= Minz_Url::display($url_next) ?>"><?= _t('gen.stream.load_more') ?></button>
  37. <?php } elseif ($hasAccess) { ?>
  38. <?= _t('gen.stream.nothing_to_load') ?>
  39. <?php if (FreshRSS_Context::userConf()->mark_read_button !== 'none') {
  40. $css = '';
  41. switch (FreshRSS_Context::userConf()->mark_read_button) {
  42. case 'big':
  43. $css = 'as-link big';
  44. break;
  45. case 'small':
  46. $css = 'btn small';
  47. break;
  48. }
  49. ?>
  50. <br />
  51. <button id="bigMarkAsRead"
  52. class="<?= $css ?> <?= FreshRSS_Context::userConf()->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
  53. form="stream-footer"
  54. formaction="<?= Minz_Url::display($url_mark_read) ?>"
  55. type="submit">
  56. <span class="bigTick">✓</span><br />
  57. <span class="markAllRead"><?= _t('gen.stream.mark_all_read') ?></span><br />
  58. <?php if (FreshRSS_Context::userConf()->onread_jump_next) { ?>
  59. <span class="jumpNext"><?= _t('conf.reading.jump_next') ?></span>
  60. <?php } ?>
  61. </button>
  62. <?php
  63. } } else { ?>
  64. <?= _t('gen.stream.nothing_to_load') ?><br />
  65. <?php } ?>
  66. </div>
  67. <?php if ($hasAccess) { ?>
  68. </form>
  69. <?php } else {?>
  70. </div>
  71. <?php }?>