nbUnreadsPerFeed.phtml 378 B

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