global.phtml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. $this->partial('nav_menu');
  3. $class = '';
  4. if (FreshRSS_Context::$user_conf->hide_read_feeds &&
  5. FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
  6. !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
  7. $class = ' state_unread';
  8. }
  9. ?>
  10. <div id="stream" class="global<?= $class ?>">
  11. <?php
  12. $params = Minz_Request::fetchGET();
  13. unset($params['c']);
  14. unset($params['a']);
  15. $url_base = array(
  16. 'c' => 'index',
  17. 'a' => 'normal',
  18. 'params' => $params,
  19. );
  20. foreach ($this->categories as $cat) {
  21. $feeds = $cat->feeds();
  22. $url_base['params']['get'] = 'c_' . $cat->id();
  23. if (!empty($feeds)) {
  24. ?>
  25. <div class="box category" data-unread="<?= $cat->nbNotRead() ?>">
  26. <div class="box-title"><a class="title" data-unread="<?= format_number($cat->nbNotRead()) ?>"
  27. href="<?= Minz_Url::display($url_base) ?>"><?= $cat->name() ?></a></div>
  28. <ul class="box-content">
  29. <?php
  30. foreach ($feeds as $feed) {
  31. $nb_not_read = $feed->nbNotRead();
  32. $error = $feed->inError() ? ' error' : '';
  33. $empty = $feed->nbEntries() === 0 ? ' empty' : '';
  34. $url_base['params']['get'] = 'f_' . $feed->id();
  35. ?>
  36. <li id="f_<?= $feed->id() ?>" class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>"
  37. data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>">
  38. <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
  39. <a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a>
  40. </li>
  41. <?php } ?>
  42. </ul>
  43. </div>
  44. <?php
  45. }
  46. }
  47. ?>
  48. </div>
  49. <div id="overlay">
  50. <a class="close" href="#"><?= _i('close') ?></a>
  51. </div>
  52. <div id="panel"<?= FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"' ?>>
  53. </div>