summaryrefslogtreecommitdiff
path: root/classes/pref_feeds.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/pref_feeds.php')
-rw-r--r--classes/pref_feeds.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/classes/pref_feeds.php b/classes/pref_feeds.php
index ec594522c..a091b735b 100644
--- a/classes/pref_feeds.php
+++ b/classes/pref_feeds.php
@@ -45,6 +45,7 @@ class Pref_Feeds extends Protected_Handler {
$root['type'] = 'category';
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
+ $show_empty_cats = get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS');
$result = db_query($this->link, "SELECT id, title FROM ttrss_feed_categories
WHERE owner_uid = " . $_SESSION["uid"] . " ORDER BY order_id, title");
@@ -80,7 +81,7 @@ class Pref_Feeds extends Protected_Handler {
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
- if (count($cat['items']) > 0)
+ if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
@@ -118,7 +119,7 @@ class Pref_Feeds extends Protected_Handler {
$cat['param'] = T_sprintf('(%d feeds)', count($cat['items']));
- if (count($cat['items']) > 0)
+ if (count($cat['items']) > 0 || $show_empty_cats)
array_push($root['items'], $cat);
$root['param'] += count($cat['items']);
@@ -170,6 +171,11 @@ class Pref_Feeds extends Protected_Handler {
return;
}
+ function togglehiddenfeedcats() {
+ set_pref($this->link, '_PREFS_SHOW_EMPTY_CATS',
+ (get_pref($this->link, '_PREFS_SHOW_EMPTY_CATS') ? 'false' : 'true'));
+ }
+
function savefeedorder() {
$data = json_decode($_POST['payload'], true);
@@ -1328,6 +1334,8 @@ class Pref_Feeds extends Protected_Handler {
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"editFeedCats()\"
dojoType=\"dijit.MenuItem\">".__('Edit categories')."</div>";
+ print "<div onclick=\"toggleHiddenFeedCats()\"
+ dojoType=\"dijit.MenuItem\">".__('(Un)hide empty categories')."</div>";
print "<div onclick=\"resetCatOrder()\"
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "</div></div>";