]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
headlines: use JSON instead of separate helper xml objects like headlines-unread
[tt-rss.git] / backend.php
index 521472051473027336449e3998d780789da67fc8..761fc0dc02351b963c23973008e0bc895cd158f7 100644 (file)
 
                        print "]]></headlines>";
 
-                       print "<headlines-count value=\"$headlines_count\"/>";
-                       print "<vgroup-last-feed value=\"$vgroup_last_feed\"/>";
+                       //print "<headlines-count value=\"$headlines_count\"/>";
+                       //print "<vgroup-last-feed value=\"$vgroup_last_feed\"/>";
 
                        $headlines_unread = ccache_find($link, $returned_feed, $_SESSION["uid"],
                                        $cat_view, true);
 
                        }
 
-                       print "<headlines-unread value=\"$headlines_unread\"/>";
-                       printf("<disable-cache value=\"%d\"/>", $disable_cache);
+                       //print "<headlines-unread value=\"$headlines_unread\"/>";
+                       //printf("<disable-cache value=\"%d\"/>", $disable_cache);
+
+                       print "<headlines-info><![CDATA[";
+
+                       $info = array("count" => (int) $headlines_count,
+                               "vgroup_last_feed" => $vgroup_last_feed,
+                               "unread" => (int) $headlines_unread,
+                               "disable_cache" => (bool) $disable_cache);
+
+                       print json_encode($info);
+
+                       print "]]></headlines-info>";
 
                        if ($_REQUEST["debug"]) $timing_info = print_checkpoint("10", $timing_info);