X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/76987cd6ea2f6e7c7ca6fc8aa45fc79532c3b4f5..b12475b5fb8b24cade1c6f469ca9017871487789:/lib/MECON/HTML/Arbol.php
diff --git a/lib/MECON/HTML/Arbol.php b/lib/MECON/HTML/Arbol.php
index 73af521..cf919b0 100644
--- a/lib/MECON/HTML/Arbol.php
+++ b/lib/MECON/HTML/Arbol.php
@@ -1,64 +1,96 @@
-
-
-require_once 'HTML/Table.php';
-require_once 'HTML/Image.php';
-
-class HTML_Arbol extends HTML_Table
-{
- var $t_interna;
-
- function HTML_Arbol($dat, $imagen)
- {
- parent::HTML_Table(array ('width'=>'132',
- 'border' => '0',
- 'cellspacing' => '0',
- 'cellpadding' => '0',
- 'bgcolor' => '#003868'));
- $this->t_interna = new HTML_Table(array ('width'=>'132',
- 'border' => '0',
- 'cellspacing' => '2',
- 'cellpadding' => '0',
- 'class' => 'bodytext'));
-/* $this->addRow(array(new HTML_Image($imagen,'',array('width'=>'132',
- 'height'=>'26',
- 'border'=>'0'))));*/
- $this->addRow(array('aa'), array('background'=>'MECON/images/arbol_titulo.gif'));
- $this->expandir($dat, 0);
- }
-
- function expandir($dat, $n)
- {
- $imagen = '';
- $bullets = array('',
- '/MECON/images/arbol_bullet_1.gif',
- '/MECON/images/arbol_bullet_2.gif',
- '/MECON/images/arbol_bullet_3.gif');
- $tabulados = array(0, 7, 13, 20);
- $classes = array('menu', 'menu1', 'menu1', 'menu2');
-
- $atr = array('border' => '0',
- 'width' => $tabulados[$n],
- 'height' => '10');
- $imagen =& new HTML_Image($bullets[$n], 'bullet', $atr);
- foreach($dat as $e)
- {
- $e['titulo'] = $imagen->toHTML().$e['titulo'];
- if(isset($e['activado']) && $e['activado'] != 0) $class = 'menu_activo';
- else $class = $classes[$n];
- if(!is_null($e['link']))
- $e['titulo'] = ''.$e['titulo'].'';
- $this->t_interna->addRow(array($e['titulo']), array('class' => $class));
- if(isset($e['sub']))
- $this->expandir($e['sub'], $n+1);
- }
- }
-
- function toHTML()
- {
- echo '';
- $this->addRow(array($this->t_interna->toHTML()));
- return parent::toHTML();
- }
-};
-
-?>
+
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+require_once 'HTML/Table.php';
+require_once 'HTML/Image.php';
+
+class HTML_Arbol extends HTML_Table
+{
+ var $t_interna;
+
+ function HTML_Arbol($dat, $titulo_str)
+ {
+ parent::HTML_Table(array ('width'=>'132',
+ 'border' => '0',
+ 'cellspacing' => '0',
+ 'cellpadding' => '0',
+ 'bgcolor' => '#003868'));
+ $this->t_interna = new HTML_Table(array ('width'=>'132',
+ 'border' => '0',
+ 'cellspacing' => '2',
+ 'cellpadding' => '0',
+ 'class' => 'bodytext'));
+ $titulo = new HTML_Table(array('width'=>'132',
+ 'height'=>'26',
+ 'border' => '0',
+ 'cellspacing' => '0',
+ 'cellpadding' => '0',
+ 'align'=>'center',
+ 'background'=>'/MECON/images/arbol_titulo.gif'));
+ $titulo->addRow(array($titulo_str), array('align'=>'center',
+ 'class'=>'arboltitulo'));
+ $this->addRow(array($titulo), array('bgcolor' => '#FFFFFF'));
+ $this->expandir($dat, 0);
+ }
+
+ function expandir($dat, $n)
+ {
+ $imagen = '';
+ $bullets = array(
+ '',
+ '/MECON/images/arbol_bullet_1.gif',
+ '/MECON/images/arbol_bullet_2.gif',
+ '/MECON/images/arbol_bullet_3.gif'
+ );
+ $tabulados = 7;
+ $classes = array('menu', 'menu1', 'menu1', 'menu2');
+
+ $atr = array('border' => '0',
+ 'width' => $n * $tabulados,
+ 'height' => '10');
+ $imagen =& new HTML_Image(@$bullets[$n] ? $bullets[$n] : '', 'bullet', $atr);
+ foreach($dat as $e)
+ {
+ $e['titulo'] = $imagen->toHTML().$e['titulo'];
+ if(isset($e['activado']) && $e['activado'] != 0) $class = 'menu_activo';
+ else $class = $classes[$n];
+ if(!is_null($e['link']))
+ $e['titulo'] = ''.$e['titulo'].'';
+ $this->t_interna->addRow(array($e['titulo']), array('class' => $class));
+ if(isset($e['sub']))
+ $this->expandir($e['sub'], $n+1);
+ }
+ }
+
+ function toHTML()
+ {
+ echo '';
+ $this->addRow(array($this->t_interna->toHTML()));
+ return parent::toHTML();
+ }
+};
+
+?>