4
0

stream-footer.phtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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') ?>
  37. <?php if (FreshRSS_Context::userConf()->mark_read_button !== 'none') {
  38. $css = '';
  39. switch (FreshRSS_Context::userConf()->mark_read_button) {
  40. case 'big':
  41. $css = 'as-link big';
  42. break;
  43. case 'small':
  44. $css = 'btn small';
  45. break;
  46. }
  47. ?>
  48. <br />
  49. <button id="bigMarkAsRead"
  50. class="<?= $css ?> <?= FreshRSS_Context::userConf()->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
  51. form="stream-footer"
  52. formaction="<?= Minz_Url::display($url_mark_read) ?>"
  53. type="submit">
  54. <span class="bigTick">✓</span><br />
  55. <span class="markAllRead"><?= _t('gen.stream.mark_all_read') ?></span><br />
  56. <?php if (FreshRSS_Context::userConf()->onread_jump_next) { ?>
  57. <span class="jumpNext"><?= _t('conf.reading.jump_next') ?></span>
  58. <?php } ?>
  59. </button>
  60. <?php
  61. } } else { ?>
  62. <?= _t('gen.stream.nothing_to_load') ?><br />
  63. <?php } ?>
  64. </div>
  65. <?php if ($hasAccess) { ?>
  66. </form>
  67. <?php } else {?>
  68. </div>
  69. <?php }?>