* @return void
* @access public
*/
- function MECON_HTML_ArbolDB($dbdata, $titulo, $link_append = '')
+ function MECON_HTML_ArbolDB($dbdata, $titulo, $link_append = '', $expandir = false)
{
if(isset($dbdata['id_padre']))
$this->padre = $dbdata['id_padre'];
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))
+
+ if($expandir)
{
- $id = $this->id_activo;
- while($id != 0)
+ $this->expandir = array($this->id_activo);
+ if(isset($this->id_activo))
{
- $sql = "SELECT $this->padre
- FROM $this->tabla
- WHERE $this->id = '".$id."'";
- $id = $this->db->getOne($sql);
- $this->expandir[] = $id;
+ $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;
+ }
}
}
{
$titulo = $row[0];
$id = $row[1];
- if(!$this->padre || !in_array($id, $this->expandir)) $sub = array();
+ if(!$this->padre || !(!isset($this->expandir) ||
+ in_array($id, $this->expandir)))
+ $sub = array();
else $sub = $this->BuscarHijos($id);
$link = strval(@$row[2]);
$d = array(
'id' => $id,
'sub' => $sub
);
+ if(isset($this->expandir) && in_array($id, $this->expandir) && $id != $this->id_activo)
+ $d['bold'] = 1;
if (!is_null($this->id_activo) and $id == $this->id_activo) {
$d['activo'] = 1;
}
vertical-align: middle\r
}\r
\r
+.menu_bold {\r
+ color: #003366;\r
+ FONT-WEIGHT: bold ;\r
+ font-family: Arial, Helvetica, sans-serif;\r
+ font-size: 10pt;\r
+ font-style: normal;\r
+ line-height: normal;\r
+ background-color: #FFFFFF;\r
+ background-position: left;\r
+ text-align: left;\r
+ vertical-align: middle\r
+}\r
+\r
.menu_activo {\r
COLOR: #003366;\r
FONT-FAMILY: Arial, Helvetica, sans-serif;\r
vertical-align: middle\r
}\r
\r
+.menu_activo_bold {\r
+ COLOR: #003366;\r
+ FONT-FAMILY: Arial, Helvetica, sans-serif;\r
+ FONT-SIZE: 10pt;\r
+ FONT-WEIGHT: bold ;\r
+ font-style: normal;\r
+ line-height: normal;\r
+ background-color: #FFCC99;\r
+ background-position: left center;\r
+ text-align: left;\r
+ vertical-align: middle\r
+}\r
+\r
.menu1 {\r
COLOR: #003366;\r
FONT-FAMILY: Arial, Helvetica, sans-serif;\r