]> git.llucax.com Git - mecon/meconlib.git/blobdiff - lib/MECON/HTML/Arbol.php
- Correccion de un bug.
[mecon/meconlib.git] / lib / MECON / HTML / Arbol.php
index 0b36067967860eab336237e48c03b5a77e04cfaa..cf919b01672db8c384d217190bba38b8cbb21363 100644 (file)
@@ -1,77 +1,96 @@
-<?\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
-    {\r
-        parent::HTML_Table(array ('width'=>'132',\r
-                                  'border'   => '0',\r
-                                  'cellspacing'   => '0',\r
-                                  'cellpadding'   => '0',\r
-                                  'bgcolor'   => '#003868'));\r
-        $this->t_interna = new HTML_Table(array ('width'=>'132',\r
-                                  'border'   => '0',\r
-                                  'cellspacing'   => '2',\r
-                                  'cellpadding'   => '0',\r
-                                  'class'   => 'bodytext'));\r
-/*        $this->addRow(array(new HTML_Image($imagen,'',array('width'=>'132',\r
-                                                           'height'=>'26',\r
-                                                           '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('<font size="2"><b class="arbol_titulo">aa</b></font>'), array('align'=>'center'));\r
-       $this->addRow(array($titulo));*/\r
-       $this->addRow(array('<table width="132" border="0" cellspacing="0" cellpadding="0" background="/MECON/images/arbol_titulo.gif" height="26">\r
-         <tr align="center"> \r
-             <td><font size="2"><b class="arbol_titulo">NOTICIAS</b></font></td>\r
-               </tr>\r
-               </table>'));\r
-        $this->expandir($dat, 0);\r
-    }\r
-    \r
-    function expandir($dat, $n)\r
-    {\r
-        $imagen = '';\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
-       \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'].'" 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
-        $this->addRow(array($this->t_interna->toHTML()));\r
-       return parent::toHTML();\r
-    }\r
-};\r
-\r
-?>\r
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+                             Ministerio de Economía
+                                    meconlib
+-------------------------------------------------------------------------------
+This file is part of meconlib.
+
+meconlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+meconlib is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+You should have received a copy of the GNU General Public License; if not,
+write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA  02111-1307  USA
+-------------------------------------------------------------------------------
+Creado: jue jul 17 15:32:52 ART 2003
+Autor:  Gonzalo Merayo <gmeray@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$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'] = '<a href="'.$e['link'].'" class="'.$class.'">'.$e['titulo'].'</a>';
+            $this->t_interna->addRow(array($e['titulo']), array('class' => $class));
+           if(isset($e['sub']))
+             $this->expandir($e['sub'], $n+1);
+       }
+    }
+
+    function toHTML()
+    {
+        echo '<link rel="stylesheet" href="/MECON/css/arbol.css">';
+        $this->addRow(array($this->t_interna->toHTML()));
+       return parent::toHTML();
+    }
+};
+
+?>