X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/a12afcaedd723ebe62e801bb3abf0dc5d6003fd3..24fd3e0f15c00f9048fc2b5ad2be287f50eb2824:/lib/MECON/Marco/MenuPrincipal.php?ds=inline diff --git a/lib/MECON/Marco/MenuPrincipal.php b/lib/MECON/Marco/MenuPrincipal.php index 0224359..146757f 100644 --- a/lib/MECON/Marco/MenuPrincipal.php +++ b/lib/MECON/Marco/MenuPrincipal.php @@ -1,31 +1,30 @@ - -// +----------------------------------------------------------------------+ -// -// $Id$ -// $Author$ -// $URL$ -// $Date$ -// $Rev$ -// + +------------------------------------------------------------------------------- +$Id$ +-----------------------------------------------------------------------------*/ +require_once 'HTML/Table.php'; // +X2C includes require_once 'MECON/Marco/MenuHorizontal.php'; @@ -112,42 +111,63 @@ class MenuPrincipal extends MenuHorizontal { else { $row = array (''.$this->_seccionSeleccionada->_nombre.''); $this->_tabla->addRow($row,'align="left" bgcolor="#336699" colspan="'.$colspan.'"'); - + //Agrego si corresponde el espacio al inicio if ($body['espacios']) { - $row = array (' '); - $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$colspan.'"'); + $espacio = ' 
'; } - // - + else { + $espacio = ''; + } + // + +//SI HAY MENU ARMO UNA TABLA, SINO TIRO DIRECTAMENTE + $row = array(); + $tmp = ''; + if ($body['menuVertical']) { + if (is_object($body['menuVertical'])) { + if (method_exists($body['menuVertical'],'toHtml')) { + $tmp.=$body['menuVertical']->toHtml(); + } else { + trigger_error('El metodo no existe!', E_USER_WARNING); + } + } else { + $tmp.=$body['menuVertical']; + } + $row[] = $tmp; + } + if (is_array($body['body'])) { $tmp = ''; + $tmp = $espacio; foreach ($body['body'] as $bod) { if (is_object($bod)) { if (method_exists($bod,'toHtml')) { $tmp.=$bod->toHtml(); - } - else { + } else { trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING); } - } - else { + } else { $tmp.=$bod; } } - $row = array ($tmp); - } - else { - $row = array ($body['body']); + $tmp.= $espacio; + $row[] = $tmp; + } else { + $row[] = $body['body']; } - $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"'); - //Agrego si corresponde el espacio al final - if ($body['espacios']) { - $row = array (' '); - $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$colspan.'"'); + if ($body['menuVertical']) { + $tabla = new HTML_Table (array('width' => '760', 'border' => 0, 'celspacing' => 0, 'celpadding' => 0)); + $tt = $tabla->addRow($row,'align="center" bgcolor="#FFFFFF"'); + $tabla->updateCellAttributes($tt, 0, 'valign="top" width="1%"'); + $contenido[] = $tabla; + } else { + $contenido = $row; } - // +// + $this->_tabla->addRow($contenido,'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"'); + } $row = array ($body['pie']); $this->_tabla->addRow($row,'align="center" bgcolor="#CCCCCC" colspan="'.$colspan.'"');