4
0

nbUnreadsPerFeed.phtml 428 B

12345678910111213141516171819
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_ViewJavascript $this */
  4. $result = [
  5. 'feeds' => [],
  6. 'tags' => [],
  7. ];
  8. foreach ($this->categories as $cat) {
  9. foreach ($cat->feeds() as $feed) {
  10. if ($feed->priority() > FreshRSS_Feed::PRIORITY_HIDDEN) {
  11. $result['feeds'][$feed->id()] = $feed->nbNotRead();
  12. }
  13. }
  14. }
  15. foreach ($this->tags as $tag) {
  16. $result['tags'][$tag->id()] = $tag->nbUnread();
  17. }
  18. echo json_encode($result);