From: Gonzalo Merayo Date: Tue, 24 Jun 2003 19:49:23 +0000 (+0000) Subject: Correccion ArbolDB para que haga listas X-Git-Tag: svn_import~449 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/8adbe6b2ffed0da44525dbdb5c502a87efb1beb0?ds=inline Correccion ArbolDB para que haga listas --- diff --git a/lib/MECON/HTML/Arbol/ArbolDB.php b/lib/MECON/HTML/Arbol/ArbolDB.php index d83d506..583a0a5 100644 --- a/lib/MECON/HTML/Arbol/ArbolDB.php +++ b/lib/MECON/HTML/Arbol/ArbolDB.php @@ -31,7 +31,7 @@ class HTML_ArbolDB extends HTML_Arbol { $sql = "SELECT $this->nombre, $this->id FROM $this->tabla "; - if(!is_null$this->padre) + if(!is_null($this->padre)) $sql .= "WHERE $this->padre = '$id'"; $result = $this->db->query($sql); if(DB::isError($result)) @@ -41,10 +41,12 @@ class HTML_ArbolDB extends HTML_Arbol { $titulo = $row[0]; $id = $row[1]; + if(is_null($this->padre)) $sub = array(); + else $sub = $this->BuscarHijos($id); $dat[] = array( 'titulo'=> $titulo, 'link' => $this->link.$id, - 'sub' => $this->BuscarHijos($id) + 'sub' => $sub ); } return $dat;