<?\r
\r
require_once 'HTML/Table.php';\r
+require_once 'HTML/Image.php';\r
\r
class HTML_Arbol extends HTML_Table\r
{\r
var $t_interna;\r
\r
- function HTML_Arbol($dat, $imagen)\r
+ function HTML_Arbol($dat, $titulo_str)\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 src="'.$imagen.'" width="132" height="26" border="0">'));\r
+ $titulo = new HTML_Table(array('width'=>'132',\r
+ 'height'=>'26',\r
+ 'border' => '0',\r
+ 'cellspacing' => '0',\r
+ 'cellpadding' => '0',\r
+ 'align'=>'center',\r
+ 'background'=>'/MECON/images/arbol_titulo.gif'));\r
+ $titulo->addRow(array($titulo_str), array('align'=>'center',\r
+ 'class'=>'arboltitulo'));\r
+ $this->addRow(array($titulo), array('bgcolor' => '#FFFFFF'));\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_bullet3.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(isset($e['activado']) && $e['activado'] != 0) $class = 'menu_activo';\r
+ else $class = $classes[$n];\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'].'" class="'.$class.'">'.$e['titulo'].'</a>';\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