summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-05 16:32:52 +0300
committerAndrew Dolgov <[email protected]>2010-11-05 16:32:52 +0300
commit11232703615a58fca38e37498ee75b69fff5ca47 (patch)
tree51756ac9c4545f84e4c6140be3a0466d2e1c9363 /functions.php
parentc7adf76040f128ce463a21ad0e48b9021cda7daf (diff)
api: fix getFeeds usage of getLabelCounters
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/functions.php b/functions.php
index a45d69485..caa95e628 100644
--- a/functions.php
+++ b/functions.php
@@ -2822,7 +2822,7 @@
return $ret_arr;
}
- function getLabelCounters($link) {
+ function getLabelCounters($link, $descriptions = false) {
$ret_arr = array();
@@ -2841,8 +2841,10 @@
$count = getFeedUnread($link, $id);
$cv = array("id" => $id,
- "counter" => $count,
- "description" => $label_name);
+ "counter" => $count);
+
+ if ($descriptions)
+ $cv["description"] = $label_name;
if (get_pref($link, 'EXTENDED_FEEDLIST'))
$cv["xmsg"] = getFeedArticles($link, $id)." ".__("total");
@@ -6662,16 +6664,16 @@
if ($cat_id == -4 || $cat_id == -2) {
$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) {
$row = array(
- "id" => $id,
- "title" => $counters[$id]["description"],
- "unread" => $counters[$id]["counter"],
+ "id" => $cv["id"],
+ "title" => $cv["description"],
+ "unread" => $cv["counter"],
"cat_id" => -2,
);