1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
4 -------------------------------------------------------------------------------
5 This file is part of mlib.
7 mlib is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your option)
12 mlib is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License; if not,
17 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------
20 Creado: Tue Apr 29 12:35:45 2003
21 Autor: Martin Marrese <mmarre@mecon.gov.ar>
22 -------------------------------------------------------------------------------
24 -----------------------------------------------------------------------------*/
26 require_once 'MLIB/Marco/Menu.php';
27 require_once 'MLIB/HTML/Image.php';
30 * Clase que se encarga del manejo de los menues horizontales
34 class MLIB_Marco_MenuHorizontal extends MLIB_Marco_Menu {
36 * Funcion para agregar el cuerpo de la pagina a la pagina
38 * @param string $body Body para agregar a la pagina
39 * @param string $titulo Titulo de la seccion seleccionada
40 * @param mixed $menu Menu a mostrar
45 function addBody($body, $titulo, $menu = null)
47 $tmp = $this->_componentes;
48 $this->_componentes = array ();
49 $this->_armarArraySecciones($tmp);
50 $tmp = $this->_tabla->addRow($this->_componentes,
51 'align="center" bgcolor="#CCCCCC" valign="top"');
52 $colspan = count($this->_componentes);
53 $width = intval (100 / $colspan);
54 for ($col=0; $col < $colspan; $col++) {
55 $this->_tabla->updateCellAttributes($tmp, $col,
56 'width="'.$width.'%"');
59 $imagen = new MLIB_HTML_Image('/MLIB/images/general_linea.gif',
60 str_repeat('=', 108));
61 $tmp = $this->_tabla->addRow(array($imagen->toHtml()),
62 'align="center" height="1" colspan="'. $colspan .'"');
66 $row = array($this->_armarEncabezado($titulo .
67 $this->_configuracion['subtitulo']));
68 $this->_tabla->addRow($row,
69 'align="left" bgcolor="#FFFFFF" colspan="'
71 $imagen = new MLIB_HTML_Image('/MLIB/images/general_linea2.gif',
72 str_repeat('.', 108), 'border="0" align="center"');
73 $this->_tabla->addRow(array ($imagen->toHtml()),
74 'align="center" colspan="'. $colspan .'"');
78 $this->resultado[] = $this->_tabla;
81 $MENUVERTICAL = new HTML_Table ('width="760"');
83 if (is_array($body)) {
84 if ($this->_configuracion['espacios']) {
85 $cuerpo.= ' <BR>';
87 foreach ($body as $bod) {
88 if (is_object($bod)) {
89 if (method_exists($bod,'toHtml')) {
90 $cuerpo.= $bod->toHtml();
93 trigger_error('El metodo no existe! - '.
94 get_class($bod).'::toHtml()',
106 $MENUVERTICAL->addRow(array($menu, $cuerpo),
108 $MENUVERTICAL->updateColAttributes(0, 'width="10%"');
109 $this->resultado[] = $MENUVERTICAL;
112 //Agrego si corresponde el espacio al inicio
113 if ($this->_configuracion['espacios']) {
114 $this->resultado[] = ' <BR>';
116 $this->resultado = array_merge($this->resultado, $body);