From 1d521296445b60b0bf8f654509cb1ca5847d93df Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Tue, 30 Oct 2007 22:20:05 +0000 Subject: [PATCH] Fix warnings Signed-off-by: Florent Bruneau git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@294 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/spool.inc.php | 13 +++++++------ banana/tree.inc.php | 7 +++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/banana/spool.inc.php b/banana/spool.inc.php index b6355b8..04c6f7c 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -344,7 +344,7 @@ class BananaSpool */ public function &getTree($id) { - return BananaTree::build($id)->data; + return BananaTree::build($id)->show(); } /** Mark the given id as read @@ -352,12 +352,13 @@ class BananaSpool */ public function markAsRead($id) { - if (!$this->overview[$id]->isread) { - $this->overview[$id]->isread = true; + $overview =& $this->overview[$id]; + if (!$overview->isread) { + $overview->isread = true; $this->unreadnb--; - while (isset($id)) { - $this->overview[$id]->descunread--; - $id = $this->overview[$id]->parent; + while (!is_null($overview)) { + $overview->descunread--; + $overview =& $overview->parent; } } } diff --git a/banana/tree.inc.php b/banana/tree.inc.php index f780bcd..6db3c44 100644 --- a/banana/tree.inc.php +++ b/banana/tree.inc.php @@ -102,6 +102,13 @@ class BananaTree 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) -- 2.1.4