1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-18 10:41:29 +00:00

api: fix getFeeds usage of getLabelCounters

This commit is contained in:
Andrew Dolgov
2010-11-05 16:32:52 +03:00
parent c7adf76040
commit 1123270361

View File

@@ -2822,7 +2822,7 @@
return $ret_arr; return $ret_arr;
} }
function getLabelCounters($link) { function getLabelCounters($link, $descriptions = false) {
$ret_arr = array(); $ret_arr = array();
@@ -2841,8 +2841,10 @@
$count = getFeedUnread($link, $id); $count = getFeedUnread($link, $id);
$cv = array("id" => $id, $cv = array("id" => $id,
"counter" => $count, "counter" => $count);
"description" => $label_name);
if ($descriptions)
$cv["description"] = $label_name;
if (get_pref($link, 'EXTENDED_FEEDLIST')) if (get_pref($link, 'EXTENDED_FEEDLIST'))
$cv["xmsg"] = getFeedArticles($link, $id)." ".__("total"); $cv["xmsg"] = getFeedArticles($link, $id)." ".__("total");
@@ -6662,16 +6664,16 @@
if ($cat_id == -4 || $cat_id == -2) { if ($cat_id == -4 || $cat_id == -2) {
$counters = getLabelCounters($link, true); $counters = getLabelCounters($link, true);
foreach (array_keys($counters) as $id) { foreach (array_values($counters) as $cv) {
$unread = $counters[$id]["counter"]; $unread = $cv["counter"];
if ($unread || !$unread_only) { if ($unread || !$unread_only) {
$row = array( $row = array(
"id" => $id, "id" => $cv["id"],
"title" => $counters[$id]["description"], "title" => $cv["description"],
"unread" => $counters[$id]["counter"], "unread" => $cv["counter"],
"cat_id" => -2, "cat_id" => -2,
); );