diff options
author | Gregor Tätzner <gregor@freenet.de> | 2012-08-02 18:52:33 +0200 |
---|---|---|
committer | Gregor Tätzner <gregor@freenet.de> | 2012-08-02 18:52:33 +0200 |
commit | bdc51593245f6495bbd7e198c5dcda8072497e12 (patch) | |
tree | b9fb41b454d647b49ff4af41294232c7152a4f8a /lib/foldermapper.php | |
parent | 1cc2f0c7f0317fc5b1a0f19a147538f51927984e (diff) |
Add feed to feed list instantly on feed adding
Reload is no longer necessary. There are still some issues - especially
the order of the feeds: atm the feed is just inserted at the beginning
Diffstat (limited to 'lib/foldermapper.php')
-rw-r--r-- | lib/foldermapper.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/foldermapper.php b/lib/foldermapper.php index 19d7e56a5..b875f1369 100644 --- a/lib/foldermapper.php +++ b/lib/foldermapper.php @@ -34,6 +34,15 @@ class OC_News_FolderMapper { */ public function populate($name, $id){ $root = new OC_News_Folder($name, $id); + + // first add child feeds + $feedmapper = new OC_News_FeedMapper(); + $feeds = $feedmapper->findByFolderId($id); + foreach ($feeds as $feed){ + $root->addChild($feed); + } + + // and second child folders $stmt = OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' WHERE user_id = ? AND parent_id = ?'); @@ -44,12 +53,6 @@ class OC_News_FolderMapper { $root->addChild($child); } - $feedmapper = new OC_News_FeedMapper(); - $feeds = $feedmapper->findByFolderId($id); - foreach ($feeds as $feed){ - $root->addChild($feed); - } - return $root; } |