From 83f5ca1886eca8af58874f3a9967ab1d5dbf5b18 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 11 Sep 2003 19:55:49 +0000 Subject: [PATCH] expandible --- lib/MECON/HTML/ArbolDB.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/MECON/HTML/ArbolDB.php b/lib/MECON/HTML/ArbolDB.php index a931a2c..177ad14 100644 --- a/lib/MECON/HTML/ArbolDB.php +++ b/lib/MECON/HTML/ArbolDB.php @@ -144,6 +144,21 @@ class MECON_HTML_ArbolDB extends MECON_HTML_Arbol if(isset($dbdata['order'])) $this->order = ' ORDER BY '.$dbdata['nombre'].' '.$dbdata['order']; $this->db = $dbdata['db']; + + $this->expandir = array($this->id_activo); + if(isset($this->id_activo)) + { + $id = $this->id_activo; + while($id != 0) + { + $sql = "SELECT $this->padre + FROM $this->tabla + WHERE $this->id = '".$id."'"; + $id = $this->db->getOne($sql); + $this->expandir[] = $id; + } + } + parent::MECON_HTML_Arbol(array(), $titulo, $link_append); $this->datos = $this->BuscarHijos(0); } @@ -179,7 +194,7 @@ class MECON_HTML_ArbolDB extends MECON_HTML_Arbol { $titulo = $row[0]; $id = $row[1]; - if(!$this->padre) $sub = array(); + if(!$this->padre || !in_array($id, $this->expandir)) $sub = array(); else $sub = $this->BuscarHijos($id); $link = strval(@$row[2]); $d = array( -- 2.43.0