]> git.wh0rd.org Git - tt-rss.git/commitdiff
support omode in rpc getAllCounters
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 7 Dec 2006 08:06:38 +0000 (09:06 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 7 Dec 2006 08:06:38 +0000 (09:06 +0100)
feedlist.js
functions.js
functions.php
modules/backend-rpc.php
tt-rss.js

index d324c6a80cccafd4599f0a80e820edda71a78dcd..caffc9387deca6c75d245353e97eb4e868700044 100644 (file)
@@ -184,7 +184,7 @@ function feedlist_init() {
                if (getActiveFeedId()) {
                        debug("some feed is open on feedlist refresh, reloading");
                        setTimeout("viewCurrentFeed()", 100);
-               }
+               } 
 
        } catch (e) {
                exception_error("feedlist/init", e);
index a3a46a9c9cd96080bc65cf5960319e2aaa2aa135..bde6098a3cc6613d49b1f365e6f4bd7e0b3e6c38 100644 (file)
@@ -782,6 +782,12 @@ function update_all_counters(feed) {
                        query = query + "&aid=" + feed;
                }
 
+               if (tagsAreDisplayed()) {
+                       query = query + "&omode=lt";
+               }
+
+               debug("update_all_counters QUERY: " + query);
+
                xmlhttp_rpc.open("GET", query, true);
                xmlhttp_rpc.onreadystatechange=all_counters_callback;
                xmlhttp_rpc.send(null);
index 7b5da022c25d750abdca9e1a108e889860b82247..84b863e700952c7182b71cbb05b2812300626d4c 100644 (file)
                        }
        }
 
-       function getAllCounters($link) {
-               getLabelCounters($link);
+       function getAllCounters($link, $omode = "tflc") {
+/*             getLabelCounters($link);
                getFeedCounters($link);
                getTagCounters($link);
                getGlobalCounters($link);
                if (get_pref($link, 'ENABLE_FEED_CATS')) {
                        getCategoryCounters($link);
+               } */
+
+               if (!$omode) $omode = "tflc";
+
+               getGlobalCounters($link);
+
+               if (strchr($omode, "l")) getLabelCounters($link);
+               if (strchr($omode, "f")) getFeedCounters($link);
+               if (strchr($omode, "t")) getTagCounters($link);
+               if (strchr($omode, "c")) {                      
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               getCategoryCounters($link);
+                       }
                }
        }       
 
 
                $owner_uid = $_SESSION["uid"];
 
-               if (!$tags) {
+               /* virtual feeds */
 
-                       /* virtual feeds */
+               if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                       print "<li class=\"feedCat\">Special</li>";
+                       print "<li id=\"feedCatHolder\"><ul class=\"feedCatList\">";
+               }
 
-                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
-                               print "<li class=\"feedCat\">Special</li>";
-                               print "<li id=\"feedCatHolder\"><ul class=\"feedCatList\">";
-                       }
+               $num_starred = getFeedUnread($link, -1);
 
-                       $num_starred = getFeedUnread($link, -1);
+               $class = "virt";
 
-                       $class = "virt";
+               if ($num_starred > 0) $class .= "Unread";
 
-                       if ($num_starred > 0) $class .= "Unread";
+               printFeedEntry(-1, $class, "Starred articles", $num_starred, 
+                       "images/mark_set.png", $link);
 
-                       printFeedEntry(-1, $class, "Starred articles", $num_starred, 
-                               "images/mark_set.png", $link);
+               if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                       print "</ul>\n";
+               }
 
-                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
-                               print "</ul>\n";
-                       }
+               if (!$tags) {
 
                        if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) {
        
index 153590589b6b979c2dc5768747e0494f2df963f8..3cba704e3ee099d89202bf767a6d51db56c0ab00 100644 (file)
                }
 
                if ($subop == "getAllCounters") {
-                       print "<rpc-reply>";
+                       print "<rpc-reply>";                    
                        print "<counters>";
-                       getAllCounters($link);
+
+                       $omode = $_GET["omode"];
+
+                       getAllCounters($link, $omode);
                        print "</counters>";
                        print_runtime_info($link);
                        print "</rpc-reply>";
index 85616b4f3fab989be7f81632c5f59393e36e9f80..533dd4f131a6a67d3f3768cef1cd15029156bba6 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -154,7 +154,7 @@ function scheduleFeedUpdate(force) {
                omode = "T";
        } else {
                if (display_tags) {
-                       omode = "t";
+                       omode = "tl";
                } else {
                        omode = "flc";
                }
@@ -190,6 +190,8 @@ function updateFeedList(silent, fetch) {
 //             notify("Loading feed list...");
 //     }
 
+       debug("<b>updateFeedList</b>");
+
        var query_str = "backend.php?op=feeds";
 
        if (display_tags) {