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