stream-footer.phtml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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' => htmlspecialchars_decode(FreshRSS_Context::$search->getRawInput(), ENT_QUOTES),
  21. 'state' => FreshRSS_Context::$state,
  22. ],
  23. ];
  24. $hasAccess = FreshRSS_Auth::hasAccess();
  25. if ($hasAccess) {
  26. ?>
  27. <form id="stream-footer" action="" method="post">
  28. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  29. <?php } else { ?>
  30. <div id="stream-footer">
  31. <?php }?>
  32. <div class="stream-footer-inner">
  33. <?php if (FreshRSS_Context::$continuation_id !== '0') { ?>
  34. <button id="load_more" type="submit" class="btn" formaction="<?= Minz_Url::display($url_next) ?>"><?= _t('gen.stream.load_more') ?></button>
  35. <?php } elseif ($hasAccess) { ?>
  36. <?= _t('gen.stream.nothing_to_load') ?><br />
  37. <button id="bigMarkAsRead"
  38. class="as-link <?= FreshRSS_Context::userConf()->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
  39. form="stream-footer"
  40. formaction="<?= Minz_Url::display($url_mark_read) ?>"
  41. type="submit">
  42. <span class="bigTick">✓</span><br />
  43. <span class="markAllRead"><?= _t('gen.stream.mark_all_read') ?></span><br />
  44. <?php if (FreshRSS_Context::userConf()->onread_jump_next) { ?>
  45. <span class="jumpNext"><?= _t('conf.reading.jump_next') ?></span>
  46. <?php } ?>
  47. </button>
  48. <?php } else { ?>
  49. <?= _t('gen.stream.nothing_to_load') ?><br />
  50. <?php } ?>
  51. </div>
  52. <?php if ($hasAccess) { ?>
  53. </form>
  54. <?php } else {?>
  55. </div>
  56. <?php }?>