X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fspool.inc.php;h=04c6f7c72c8e2df184222393f84f761936962800;hb=1d521296445b60b0bf8f654509cb1ca5847d93df;hp=b6355b8f126140ae65ede94b1001d23308aeb233;hpb=d3b026ab2c8ff2b0c5ca83a72cc08a7a81b38db2;p=banana.git 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; } } }