support omode in rpc getAllCounters
This commit is contained in:
parent
0b126ac277
commit
cf4d339c28
5 changed files with 50 additions and 26 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1480,13 +1480,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2727,28 +2740,28 @@
|
|||
|
||||
$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) {
|
||||
|
||||
/* 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')) {
|
||||
|
||||
$result = db_query($link, "SELECT id,sql_exp,description FROM
|
||||
|
|
|
@ -42,9 +42,12 @@
|
|||
}
|
||||
|
||||
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>";
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue