From: Gonzalo Merayo Date: Tue, 8 Jul 2003 20:33:12 +0000 (+0000) Subject: BugFixes a la primera version de addMenuVertical de Marco X-Git-Tag: svn_import~395 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/6a10967bfaa5f6fc91beff67c4419f1a3c9b29c8?ds=inline BugFixes a la primera version de addMenuVertical de Marco --- diff --git a/lib/MECON/Marco/MenuOculto.php b/lib/MECON/Marco/MenuOculto.php index 4f63cad..3abfc3f 100644 --- a/lib/MECON/Marco/MenuOculto.php +++ b/lib/MECON/Marco/MenuOculto.php @@ -71,7 +71,6 @@ class MenuOculto extends Menu { */ function addBody($body, $titulo, $espacios = true, $menu = null) // ~X2C { - if ($menu) { $colspan = 2; } @@ -125,6 +124,8 @@ class MenuOculto extends Menu { } } $row[] = $tmp; + + var_dump($row); $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF"'); //Agrego si corresponde el espacio al final diff --git a/lib/MECON/Marco/MenuPrincipal.php b/lib/MECON/Marco/MenuPrincipal.php index 0224359..eedc3c3 100644 --- a/lib/MECON/Marco/MenuPrincipal.php +++ b/lib/MECON/Marco/MenuPrincipal.php @@ -25,7 +25,7 @@ // #require_once 'PEAR.php'; - +require_once 'HTML/Table.php'; // +X2C includes require_once 'MECON/Marco/MenuHorizontal.php'; @@ -112,16 +112,43 @@ class MenuPrincipal extends MenuHorizontal { else { $row = array (''.$this->_seccionSeleccionada->_nombre.''); $this->_tabla->addRow($row,'align="left" bgcolor="#336699" colspan="'.$colspan.'"'); - + + if ($body['menuVertical']) { + $cols = 2; + } + else { + $cols = 1; + } + + $tabla = new HTML_Table (array('width' => '100%', 'border' => 0, 'celspacing' => 0, 'celpadding' => 0)); //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 = ''; + } + // + $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')) { @@ -135,19 +162,16 @@ class MenuPrincipal extends MenuHorizontal { $tmp.=$bod; } } - $row = array ($tmp); + $tmp.= $espacio; + $row[] = $tmp; } else { - $row = array ($body['body']); + $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.'"'); - } - // + $tt = $tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'); + $tabla->updateCellAttributes($tt, 0, 'valign="top" width="1%"'); + $this->_tabla->addRow(array($tabla->toHtml()),'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"'); + } $row = array ($body['pie']); $this->_tabla->addRow($row,'align="center" bgcolor="#CCCCCC" colspan="'.$colspan.'"'); diff --git a/lib/MECON/Marco/MenuVertical.php b/lib/MECON/Marco/MenuVertical.php index f857325..5491c51 100644 --- a/lib/MECON/Marco/MenuVertical.php +++ b/lib/MECON/Marco/MenuVertical.php @@ -133,4 +133,4 @@ class MenuVertical extends Menu { } // -X2C Class :MenuVertical -?> \ No newline at end of file +?>