]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix preffiltertree layout being wrong
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 31 Aug 2012 09:00:23 +0000 (13:00 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 31 Aug 2012 09:00:23 +0000 (13:00 +0400)
classes/pref/filters.php

index 04077e52f6ca9d12c43a7cfcfb8350f3c0141241..1645639ed118279f46f149d3b2da64668c784a0a 100644 (file)
@@ -125,12 +125,12 @@ class Pref_Filters extends Handler_Protected {
 
                        if ($action_id != $line["action_id"]) {
                                if (count($folder['items']) > 0) {
-                                       $folder['id'] = $line["action_id"];
-                                       $folder['name'] = $line["action_name"];
-
                                        array_push($root['items'], $folder);
                                }
+
                                $folder = array();
+                               $folder['id'] = $line["action_id"];
+                               $folder['name'] = $line["action_name"];
                                $folder['items'] = array();
                                $action_id = $line["action_id"];
                        }
@@ -148,6 +148,10 @@ class Pref_Filters extends Handler_Protected {
                        array_push($folder['items'], $filter);
                }
 
+               if (count($folder['items']) > 0) {
+                       array_push($root['items'], $folder);
+               }
+
                $fl = array();
                $fl['identifier'] = 'id';
                $fl['label'] = 'name';