stream-footer.phtml 1.8 KB

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