From: Andrew Dolgov Date: Fri, 31 Aug 2012 09:00:23 +0000 (+0400) Subject: fix preffiltertree layout being wrong X-Git-Tag: 1.6.0~93 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e8b703878decaf05d4d93954c2632c0d3bc338d9;p=tt-rss.git fix preffiltertree layout being wrong --- diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 04077e52..1645639e 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -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';