]> git.llucax.com Git - mecon/meconlib.git/blobdiff - lib/MECON/Marco/MenuVertical.php
BugFix.
[mecon/meconlib.git] / lib / MECON / Marco / MenuVertical.php
index bf5700a162f01a5051c29312b150f4cfc3ec1626..bb2cd93ccf29cbb8db261c040f5e66ed3763e5f9 100644 (file)
@@ -44,8 +44,6 @@ class MECON_Marco_MenuVertical extends MECON_Marco_Menu {
      */
     function addBody($body, $titulo, $menu = null)
     {
-        $c= count($this->_componentes); 
-        
         $tmp = $this->_componentes;
         $this->_componentes = array ();
         $this->_armarArraySecciones($tmp);
@@ -53,80 +51,69 @@ class MECON_Marco_MenuVertical extends MECON_Marco_Menu {
         $TABLA = new HTML_Table('width=152 align="left" cellspacing="0"
                                  cellpadding="0" border="0" height="1"
                                  background="/MECON/images/general_titulo_menu.gif"');
-        
-        $menutmp ='<font face="Arial, Helvetica, sans-serif" size="3"
-            color="#000000"><p>&nbsp;'.$titulo.'</p></font>';
-        $row = array ($menutmp);
-        $TABLA->addRow($row,'align="left"');        
+        $menutmp ='<div class="mecon_marco_subtitle_vertical">&nbsp;'.$titulo.'</div>';
+        $TABLA->addRow(array ($menutmp),'align="left"');        
         $TABLA->updateCellAttributes(0,0,'colspan="2"');
         
-        $SEP = array('<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=36>',
-                     '<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=118>'
-                    );
-        $TABLA->addRow($SEP);
-       
+        $TABLA->addRow(
+                array(
+                    '<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=36>',
+                    '<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=118>'
+                    )
+                );
+
         foreach ($this->_componentesVertical as $comp) {
             $TABLA->addRow($comp,'align="left"  height="3"
                     background="/MECON/images/general_fondo_gris"');
-            $TABLA->updateColAttributes(0,'align="right" width="34" height="3"');
+            $TABLA->updateColAttributes(0,
+                    'align="right" width="34" height="3"');
             $TABLA->updateColAttributes(1,'align="left"  width="118"');
-            $TABLA->addRow($SEP);
+            $TABLA->addRow(
+                array(
+                    '<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=36>',
+                    '<IMG height="3" src="/MECON/images/general_linea_relieve.gif" width=118>'
+                    )
+                );
         }
         $TABLA->updateCellAttributes(0,0,'align="left"');
-        $row = array ($TABLA->toHtml());
-        
-        $this->_tabla->addRow($row,'width=152 align="left" bgcolor="#FFFFFF" valign="top"');
 
-        //AGREGO EL CUERPO
-        $TABLA2 = new HTML_Table('width="600"align="right" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0"');
-        $row = array();
-        $tmp = '';
-        //AGREGO EL MENU VERTICAL
-        if ($menu) {
-            if (is_object($menu)) {
-                if (method_exists($menu,'toHtml')) {
-                    $tmp.=$menu->toHtml();
-                }
-                else {
-                    trigger_error('El metodo no existe!', E_USER_WARNING);
-                }                
+        $cuerpo = '';
+        if (is_array($body)) {
+            if ($this->_configuracion['espacios']) {
+                $cuerpo.= '&nbsp;<BR>';
             }
-            else {
-                $tmp.=$menu;
-            }
-            $row[] = $tmp;
-        }
-        $tmp = '';
-        //Agrego si corresponde el espacio al inicio
-        if ($this->_configuracion['espacios']) {
-            $tmp.='&nbsp;<BR>';
-        }
-
-        foreach ($body as $bod) {
-            if (is_object($bod)) {
-                if (method_exists($bod,'toHtml')) {
-                    $tmp.=$bod->toHtml();
-                }
+            foreach ($body as $bod) {
+                if (is_object($bod)) {
+                    if (method_exists($bod,'toHtml')) {
+                        $cuerpo.= $bod->toHtml();
+                    } 
+                    else {
+                        trigger_error('El metodo no existe! - '. 
+                                get_class($bod).'::toHtml()', 
+                                E_USER_WARNING);
+                    }
+                } 
                 else {
-                    trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
-                }                
-            }
-            else {
-                $tmp.=$bod;
+                    $cuerpo.= $bod;
+                }
             }
-        }        
-        //Agrego si corresponde el espacio al final
-        if ($this->_configuracion['espacios']) {
-            $tmp.='<BR>&nbsp;';
+        } 
+        else {
+            $cuerpo = $body;
+        }
+        
+        if ($menu) {
+            $MENUVERTICAL = new HTML_Table ('width="608"
+                    bgcolor="#FFFFFF"');
+            $MENUVERTICAL->addRow(array($menu, $cuerpo),
+                    'valign="top"');
+            $MENUVERTICAL->updateColAttributes(0, 'width="10%"');
+            $cuerpo = $MENUVERTICAL;
         }
-        $row[] = $tmp;
-        $TABLA2->addRow($row, 'valign="top"');
-        $row = array ($TABLA2->toHtml());
-        $this->_tabla->setCellContents  (0,2,$row);
-        $this->_tabla->setCellAttributes(0,2,'align="center" bgcolor="#FFFFFF" valign="top"');
 
-        $this->_tabla->updateColAttributes (1,'width="8" bgcolor="#FFFFFF"');
-        $this->_tabla->updateColAttributes (2,'width="600" bgcolor="#FFFFFF"');
+        $this->_tabla->addRow(array($TABLA, $cuerpo),'align="left" bgcolor="#FFFFFF" valign="top"');
+        $this->_tabla->updateColAttributes(0, 'width="10%"');
+        $this->resultado[] = $this->_tabla;
     }
 }
 ?>
\ No newline at end of file