<?\r
\r
require_once 'HTML/Table.php';\r
+require_once 'HTML/Image.php';\r
\r
class HTML_Arbol extends HTML_Table\r
{\r
'cellspacing' => '2',\r
'cellpadding' => '0',\r
'class' => 'bodytext'));\r
- $this->addRow(array('<img src="'.$imagen.'" width="132" height="26" border="0">'));\r
+ $this->addRow(array(new HTML_Image($imagen,'',array('width'=>'132',\r
+ 'height'=>'26',\r
+ 'border'=>'0'))));\r
$this->expandir($dat, 0);\r
}\r
+ \r
function expandir($dat, $n)\r
{\r
$imagen = '';\r
- $class = 'menu';\r
$bullets = array('',\r
'/MECON/images/arbol_bullet_1.gif',\r
'/MECON/images/arbol_bullet_2.gif',\r
'/MECON/images/arbol_bullet_3.gif');\r
$tabulados = 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
+ \r
+ $atr = array('border' => '0',\r
+ 'width' => $tabulados[$n],\r
+ 'height' => '10');\r
+ $imagen =& new HTML_Image($bullets[$n], 'bullet', $atr);\r
foreach($dat as $e)\r
{\r
+ $e['titulo'] = $imagen->toHTML().$e['titulo'];\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 = $classes[$n];\r
- $this->t_interna->addRow(array($e['titulo']), array('class' => $class_a));\r
+ $e['titulo'] = '<a href="'.$e['link'].'">'.$e['titulo'].'</a>';\r
+ if(isset($e['activado']) && $e['activado'] != 0) $class = 'menu_activo';\r
+ else $class = $classes[$n];\r
+ $this->t_interna->addRow(array($e['titulo']), array('class' => $class));\r
if(isset($e['sub']))\r
$this->expandir($e['sub'], $n+1);\r
}\r
}\r
+\r
function toHTML()\r
{\r
echo '<link rel="stylesheet" href="/MECON/css/arbol.css">';\r