global.phtml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $cat->name() ?></a></div>
  27. <ul class="box-content">
  28. <?php
  29. foreach ($feeds as $feed) {
  30. $nb_not_read = $feed->nbNotRead();
  31. $error = $feed->inError() ? ' error' : '';
  32. $empty = $feed->nbEntries() === 0 ? ' empty' : '';
  33. $url_base['params']['get'] = 'f_' . $feed->id();
  34. ?>
  35. <li id="f_<?= $feed->id() ?>" class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>" data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>">
  36. <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
  37. <a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a>
  38. </li>
  39. <?php } ?>
  40. </ul>
  41. </div>
  42. <?php
  43. }
  44. }
  45. ?>
  46. </div>
  47. <div id="overlay">
  48. <a class="close" href="#"><?= _i('close') ?></a>
  49. </div>
  50. <div id="panel"<?= FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"' ?>>
  51. </div>