summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-24 15:25:06 +0300
committerAndrew Dolgov <[email protected]>2009-12-24 15:25:06 +0300
commit57937c42b99d94a4046986bbfb59fdf8d765408a (patch)
tree7e2ea1b319101915806c36ea76b84c4022bceed3 /backend.php
parent44258fa967a8804a80d84ebd845a8668c18ca890 (diff)
obsolete cookie storage for collapsed status of feedlist and special categories (bump schema)
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/backend.php b/backend.php
index aa8edb7ba..a25a0b5be 100644
--- a/backend.php
+++ b/backend.php
@@ -174,9 +174,33 @@
case "collapse":
$cat_id = db_escape_string($_GET["cid"]);
- db_query($link, "UPDATE ttrss_feed_categories SET
- collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " .
- $_SESSION["uid"]);
+ if ($cat_id > 0) {
+ db_query($link, "UPDATE ttrss_feed_categories SET
+ collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " .
+ $_SESSION["uid"]);
+ } else {
+ $pref_name = '';
+
+ switch ($cat_id) {
+ case -1:
+ $pref_name = '_COLLAPSED_SPECIAL';
+ break;
+ case -2:
+ $pref_name = '_COLLAPSED_LABELS';
+ break;
+ case 0:
+ $pref_name = '_COLLAPSED_UNCAT';
+ break;
+ }
+
+ if ($pref_name) {
+ if (get_pref($link, $pref_name)) {
+ set_pref($link, $pref_name, 'false');
+ } else {
+ set_pref($link, $pref_name, 'true');
+ }
+ }
+ }
return;
break;