diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-08 19:11:22 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-08 19:11:22 +0200 |
commit | 9fcfdae0c275eea9d3835552404a291b00043492 (patch) | |
tree | 6e9057078c88f2446c9ec67ab760388fc1a02253 /lib/foldermapper.php | |
parent | 9ad5cc8fda71ac11a1ddd52554837596dc6aa43a (diff) |
remember collapsed folders, simplyfied css and js
Diffstat (limited to 'lib/foldermapper.php')
-rw-r--r-- | lib/foldermapper.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/foldermapper.php b/lib/foldermapper.php index 431d80893..28abad0e6 100644 --- a/lib/foldermapper.php +++ b/lib/foldermapper.php @@ -43,6 +43,7 @@ class FolderMapper { while( $row = $result->fetchRow()) { $folderid = $row['id']; $folder = new Folder($row['name'], $folderid); + $folder->setOpened($row['opened']); $children = self::childrenOf($folderid); $folder->addChildren($children); $folderlist[] = $folder; @@ -69,6 +70,7 @@ class FolderMapper { while( $row = $result->fetchRow()) { $folderid = $row['id']; $folder = new Folder($row['name'], $folderid); + $folder->setOpened($row['opened']); $children = self::childrenOfWithFeeds($folderid); $folder->addChildren($children); $collectionlist[] = $folder; @@ -91,6 +93,7 @@ class FolderMapper { $row = $result->fetchRow(); $folder = new Folder($row['name'], $row['id']); + $folder->setOpened($row['opened']); return $folder; } @@ -103,8 +106,8 @@ class FolderMapper { public function save(Folder $folder) { $query = \OCP\DB::prepare(' INSERT INTO ' . self::tableName . - '(name, parent_id, user_id) - VALUES (?, ?, ?) + '(name, parent_id, user_id, opened) + VALUES (?, ?, ?, ?) '); $name = $folder->getName(); @@ -117,9 +120,10 @@ class FolderMapper { $parentid = $folder->getParentId(); $params=array( - $name, - $parentid, - $this->userid + $name, + $parentid, + $this->userid, + $folder->getOpened() ); $query->execute($params); $folderid = \OCP\DB::insertid(self::tableName); @@ -135,9 +139,9 @@ class FolderMapper { */ public function update(Folder $folder) { $query = \OCP\DB::prepare('UPDATE ' . self::tableName - . ' SET name = ? ' . ' WHERE id = ?'); + . ' SET name = ?, opened = ?' . ' WHERE id = ?'); - $params = array($folder->getName(), $folder->getId()); + $params = array($folder->getName(), $folder->getOpened(), $folder->getId()); $query->execute($params); return true; } |