Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@294
9869982d-c50d-0410-be91-
f2a2ec7c7c7b
*/
public function &getTree($id)
{
*/
public function &getTree($id)
{
- return BananaTree::build($id)->data;
+ return BananaTree::build($id)->show();
}
/** Mark the given id as read
}
/** Mark the given id as read
*/
public function markAsRead($id)
{
*/
public function markAsRead($id)
{
- if (!$this->overview[$id]->isread) {
- $this->overview[$id]->isread = true;
+ $overview =& $this->overview[$id];
+ if (!$overview->isread) {
+ $overview->isread = true;
- while (isset($id)) {
- $this->overview[$id]->descunread--;
- $id = $this->overview[$id]->parent;
+ while (!is_null($overview)) {
+ $overview->descunread--;
+ $overview =& $overview->parent;
file_put_contents(BananaTree::filename($id), serialize($this));
}
file_put_contents(BananaTree::filename($id), serialize($this));
}
+ /** Return html to display the tree
+ */
+ public function &show()
+ {
+ return $this->data;
+ }
+
/** Get filename
*/
static private function filename($id)
/** Get filename
*/
static private function filename($id)