{\r
var $t_interna;\r
\r
- function HTML_Arbol($dat)\r
+ function HTML_Arbol($dat, $imagen)\r
{\r
parent::HTML_Table(array ('width'=>'132',\r
'border' => '0',\r
'cellspacing' => '2',\r
'cellpadding' => '0',\r
'class' => 'bodytext'));\r
- $this->addRow(array('<img name="noticias" src="/MECON/images/arbol_noticias.gif" width="132" height="26" border="0">'));\r
+ $this->addRow(array('<img src="'.$imagen.'" width="132" height="26" border="0">'));\r
$this->expandir($dat, 0);\r
}\r
function expandir($dat, $n)\r
{\r
$imagen = '';\r
- $class = 'menu'; \r
- switch($n){\r
- case 1: $imagen = '<img src="/MECON/images/arbol_bullet_1.gif" width="7" height="10">';\r
- $class = 'menu1'; \r
- break;\r
- case 2: $imagen = '<img src="/MECON/images/arbol_bullet_2.gif" width="13" height="10">';\r
- $class = 'menu1'; \r
- break;\r
- case 3: $imagen = '<img src="/MECON/images/arbol_bullet3.gif" width="20" height="10">';\r
- $class = 'menu2'; \r
- break;\r
- }\r
+ $class = 'menu';\r
+ $bullets = array('', '/MECON/images/arbol_bullet_1.gif', '/MECON/images/arbol_bullet_2.gif', '/MECON/images/arbol_bullet3.gif');\r
+ $tabulaciones = array(0, 7, 13, 20);\r
+ $classes = array('menu', 'menu1', 'menu1', 'menu2');\r
+ $imagen = '<img src="'.$bullets[$n].'"\r
+ width="'.$tabulados[$n].'"\r
+ height="10">';\r
foreach($dat as $e)\r
{\r
if(!is_null($e['link']))\r
$e['titulo'] = '<a href="'.$e['link'].'">'.$imagen.$e['titulo'].'</a>';\r
if(isset($e['activado']) && $e['activado'] != 0) $class_a = 'menu_activo';\r
- else $class_a = $class;\r
+ else $class_a = $class[$n];\r
$this->t_interna->addRow(array($e['titulo']), array('class' => $class_a));\r
if(isset($e['sub']))\r
$this->expandir($e['sub'], $n+1);\r