support omode in rpc getAllCounters

This commit is contained in:
Andrew Dolgov 2006-12-07 09:06:38 +01:00
parent 0b126ac277
commit cf4d339c28
5 changed files with 50 additions and 26 deletions

View file

@ -184,7 +184,7 @@ function feedlist_init() {
if (getActiveFeedId()) { if (getActiveFeedId()) {
debug("some feed is open on feedlist refresh, reloading"); debug("some feed is open on feedlist refresh, reloading");
setTimeout("viewCurrentFeed()", 100); setTimeout("viewCurrentFeed()", 100);
} }
} catch (e) { } catch (e) {
exception_error("feedlist/init", e); exception_error("feedlist/init", e);

View file

@ -782,6 +782,12 @@ function update_all_counters(feed) {
query = query + "&aid=" + 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.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=all_counters_callback; xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null); xmlhttp_rpc.send(null);

View file

@ -1480,13 +1480,26 @@
} }
} }
function getAllCounters($link) { function getAllCounters($link, $omode = "tflc") {
getLabelCounters($link); /* getLabelCounters($link);
getFeedCounters($link); getFeedCounters($link);
getTagCounters($link); getTagCounters($link);
getGlobalCounters($link); getGlobalCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (get_pref($link, 'ENABLE_FEED_CATS')) {
getCategoryCounters($link); 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);
}
} }
} }
@ -2727,28 +2740,28 @@
$owner_uid = $_SESSION["uid"]; $owner_uid = $_SESSION["uid"];
/* virtual feeds */
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);
$class = "virt";
if ($num_starred > 0) $class .= "Unread";
printFeedEntry(-1, $class, "Starred articles", $num_starred,
"images/mark_set.png", $link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print "</ul>\n";
}
if (!$tags) { if (!$tags) {
/* virtual feeds */
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);
$class = "virt";
if ($num_starred > 0) $class .= "Unread";
printFeedEntry(-1, $class, "Starred articles", $num_starred,
"images/mark_set.png", $link);
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print "</ul>\n";
}
if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) { if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) {
$result = db_query($link, "SELECT id,sql_exp,description FROM $result = db_query($link, "SELECT id,sql_exp,description FROM

View file

@ -42,9 +42,12 @@
} }
if ($subop == "getAllCounters") { if ($subop == "getAllCounters") {
print "<rpc-reply>"; print "<rpc-reply>";
print "<counters>"; print "<counters>";
getAllCounters($link);
$omode = $_GET["omode"];
getAllCounters($link, $omode);
print "</counters>"; print "</counters>";
print_runtime_info($link); print_runtime_info($link);
print "</rpc-reply>"; print "</rpc-reply>";

View file

@ -154,7 +154,7 @@ function scheduleFeedUpdate(force) {
omode = "T"; omode = "T";
} else { } else {
if (display_tags) { if (display_tags) {
omode = "t"; omode = "tl";
} else { } else {
omode = "flc"; omode = "flc";
} }
@ -190,6 +190,8 @@ function updateFeedList(silent, fetch) {
// notify("Loading feed list..."); // notify("Loading feed list...");
// } // }
debug("<b>updateFeedList</b>");
var query_str = "backend.php?op=feeds"; var query_str = "backend.php?op=feeds";
if (display_tags) { if (display_tags) {