stream-footer.phtml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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="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. <button id="bigMarkAsRead"
  32. class="as-link <?= FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
  33. form="stream-footer"
  34. formaction="<?= Minz_Url::display($url_mark_read) ?>"
  35. type="submit">
  36. <?= _t('gen.stream.nothing_to_load') ?><br />
  37. <span class="bigTick">✓</span><br />
  38. <?= _t('gen.stream.mark_all_read') ?>
  39. </button>
  40. <?php } else { ?>
  41. <div id="bigMarkAsRead">
  42. <?= _t('gen.stream.nothing_to_load') ?><br />
  43. </div>
  44. <?php } ?>
  45. </div>
  46. <?php if ($hasAccess) { ?>
  47. </form>
  48. <?php } else {?>
  49. </div>
  50. <?php }?>