]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: show virtual feeds in getFeeds
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 11:08:11 +0000 (14:08 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 11:08:11 +0000 (14:08 +0300)
api/index.php

index 789bfca3147a97fb6e1f35d24a88c25c6b27be29..f0f7aa20248e64951935e9a7ca73e111dfcad969 100644 (file)
 
                                if ($unread || !$unread_only) {
 
-                                       $line_struct = array(
+                                       $row = array(
                                                        "feed_url" => $line["feed_url"],
                                                        "title" => $line["title"],
                                                        "id" => (int)$line["id"],
                                                        "last_updated" => strtotime($line["last_updated"])
                                                );
        
-                                       array_push($feeds, $line_struct);
+                                       array_push($feeds, $row);
+                               }
+                       }
+
+                       if (!$cat_id || $cat_id == -1) {
+                               $counters = getLabelCounters($link, false, true);
+
+                               foreach (array_keys($counters) as $id) {
+
+                                       $unread = $counters[$id]["counter"];
+       
+                                       if ($unread || !$unread_only) {
+       
+                                               $row = array(
+                                                               "id" => $id,
+                                                               "title" => $counters[$id]["description"],
+                                                               "unread" => $counters[$id]["counter"],
+                                                               "cat_id" => -1,
+                                                       );
+       
+                                               array_push($feeds, $row);
+                                       }
                                }
                        }