]> git.llucax.com Git - mecon/meconlib.git/blobdiff - lib/MECON/HTML/Arbol.php
ArbolDB terminado
[mecon/meconlib.git] / lib / MECON / HTML / Arbol.php
index 4931356152d284142ebf849ca42fb20ac72460c6..5cc26603a0f8a4e62f841dd0c541bf314e1cd88f 100644 (file)
@@ -6,7 +6,7 @@ class HTML_Arbol extends HTML_Table
 {\r
     var $t_interna;\r
     \r
 {\r
     var $t_interna;\r
     \r
-    function Arbol($dat)\r
+    function HTML_Arbol($dat, $imagen)\r
     {\r
         parent::HTML_Table(array ('width'=>'132',\r
                                   'border'   => '0',\r
     {\r
         parent::HTML_Table(array ('width'=>'132',\r
                                   'border'   => '0',\r
@@ -18,30 +18,28 @@ class HTML_Arbol extends HTML_Table
                                   'cellspacing'   => '2',\r
                                   'cellpadding'   => '0',\r
                                   'class'   => 'bodytext'));\r
                                   'cellspacing'   => '2',\r
                                   'cellpadding'   => '0',\r
                                   'class'   => 'bodytext'));\r
-        $this->addRow(array('<img name="noticias" src="MECON/images/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
         $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('',\r
+                        '/MECON/images/arbol_bullet_1.gif',\r
+                        '/MECON/images/arbol_bullet_2.gif',\r
+                        '/MECON/images/arbol_bullet3.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
         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
         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 = $classes[$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
             $this->t_interna->addRow(array($e['titulo']), array('class' => $class_a));\r
            if(isset($e['sub']))\r
              $this->expandir($e['sub'], $n+1);\r
@@ -49,7 +47,7 @@ class HTML_Arbol extends HTML_Table
     }\r
     function toHTML()\r
     {\r
     }\r
     function toHTML()\r
     {\r
-        echo '<link rel="stylesheet" href="MECON/css/arbol.css">';\r
+        echo '<link rel="stylesheet" href="/MECON/css/arbol.css">';\r
         $this->addRow(array($this->t_interna->toHTML()));\r
        return parent::toHTML();\r
     }\r
         $this->addRow(array($this->t_interna->toHTML()));\r
        return parent::toHTML();\r
     }\r