X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/997feeab434ec1ab5b6b94b8255068d732f8085f..511afeece45e35328bb8fe4e56ab0453554b7689:/lib/MECON/Marco/MenuHorizontal.php diff --git a/lib/MECON/Marco/MenuHorizontal.php b/lib/MECON/Marco/MenuHorizontal.php index 11ee406..c20d45e 100644 --- a/lib/MECON/Marco/MenuHorizontal.php +++ b/lib/MECON/Marco/MenuHorizontal.php @@ -45,83 +45,77 @@ class MECON_Marco_MenuHorizontal extends MECON_Marco_Menu { */ function addBody($body, $titulo, $menu = null) { - $tmp = $this->_componentes; $this->_componentes = array (); $this->_armarArraySecciones($tmp); - $this->_tabla->addRow($this->_componentes,'align="center" bgcolor="#CCCCCC" valign="top"'); - $c = count($this->_componentes); - - $colcount = $this->_tabla->getColCount(); - $width = 100 / $colcount; - for ($col=0; $col < $colcount; $col++) { - $this->_tabla->updateColAttributes($col,'width="'.$width.'%"'); - } + $tmp = $this->_tabla->addRow($this->_componentes, + 'align="center" bgcolor="#CCCCCC" valign="top"'); + $colspan = count($this->_componentes); + $width = intval (100 / $colspan); + for ($col=0; $col < $colspan; $col++) { + $this->_tabla->updateCellAttributes($tmp, $col, + 'width="'.$width.'%"'); + } - $imagen = new MECON_HTML_Image('/MECON/images/general_linea.gif', str_repeat('=', 108)); - $i = $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"'); - $this->_tabla->updateRowAttributes($i, 'height="1"'); + $imagen = new MECON_HTML_Image('/MECON/images/general_linea.gif', + str_repeat('=', 108)); + $tmp = $this->_tabla->addRow(array($imagen->toHtml()), + 'align="center" height="1" colspan="'. $colspan .'"'); //Agrego el titulo - $row = array - ($this->_armarEncabezado($titulo.$this->_configuracion['subtitulo'])); - $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"'); + $row = array($this->_armarEncabezado($titulo . + $this->_configuracion['subtitulo'])); + $this->_tabla->addRow($row, + 'align="left" bgcolor="#FFFFFF" colspan="' + . $colspan .'"'); $imagen = new MECON_HTML_Image('/MECON/images/general_linea2.gif', - str_repeat('.', 108), array('border' => 0, 'align' => 'center')); - $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"'); - // - + str_repeat('.', 108), 'border="0" align="center"'); + $this->_tabla->addRow(array ($imagen->toHtml()), + 'align="center" colspan="'. $colspan .'"'); + $tmp=''; + + $this->resultado[] = $this->_tabla; - //Agrego si corresponde el espacio al inicio - if ($this->_configuracion['espacios']) { - $row = array (' '); - $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"'); - } - // - //AGREGO EL MENU VERTICAL - $TABLA = new HTML_Table('width=760 align="center" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0"'); - $row = array(); - $tmp = ''; if ($menu) { - if (is_object($menu)) { - if (method_exists($menu,'toHtml')) { - $tmp.=$menu->toHtml(); + $MENUVERTICAL = new HTML_Table ('width="760" align="left"'); + $cuerpo = ''; + if (is_array($body)) { + if ($this->_configuracion['espacios']) { + $cuerpo.= ' 
'; } - else { - trigger_error('El metodo no existe!', E_USER_WARNING); - } - } - else { - $tmp.=$menu; - } - $row[] = $tmp; - } - $tmp = ''; - 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 { + $cuerpo.= $bod; + } } - else { - trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING); - } - } + } else { - $tmp.=$bod; + $cuerpo = $body; } + $MENUVERTICAL->addRow(array($menu, $cuerpo), + 'valign="top"'); + $MENUVERTICAL->updateColAttributes(0, 'width="10%"'); + $this->resultado[] = $MENUVERTICAL; } - $row[] = $tmp; - $TABLA->addRow($row); - $row = array ($TABLA->toHtml()); - $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$c.'" valign="top"'); - //Agrego si corresponde el espacio al final - if ($this->_configuracion['espacios']) { - $row = array (' '); - $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"'); + else { + //Agrego si corresponde el espacio al inicio + if ($this->_configuracion['espacios']) { + $this->resultado[] = ' 
'; + } + $this->resultado = array_merge($this->resultado, $body); } - // } } ?> \ No newline at end of file