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)
49 $tmp = $this->_componentes;
50 $this->_componentes = array ();
51 $this->_armarArraySecciones($tmp);
52 $this->_tabla->addRow($this->_componentes,'align="center" bgcolor="#CCCCCC" valign="top"');
53 $c = count($this->_componentes);
55 $colcount = $this->_tabla->getColCount();
56 $width = 100 / $colcount;
57 for ($col=0; $col < $colcount; $col++) {
58 $this->_tabla->updateColAttributes($col,'width="'.$width.'%"');
61 $imagen = new MECON_HTML_Image('/MECON/images/general_linea.gif', str_repeat('=', 108));
62 $i = $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"');
63 $this->_tabla->updateRowAttributes($i, 'height="1"');
68 ($this->_armarEncabezado($titulo.$this->_configuracion['subtitulo']));
69 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
70 $imagen = new MECON_HTML_Image('/MECON/images/general_linea2.gif',
71 str_repeat('.', 108), array('border' => 0, 'align' => 'center'));
72 $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"');
77 //Agrego si corresponde el espacio al inicio
78 if ($this->_configuracion['espacios']) {
79 $row = array (' ');
80 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
83 //AGREGO EL MENU VERTICAL
84 $TABLA = new HTML_Table('width=760 align="center" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0"');
88 if (is_object($menu)) {
89 if (method_exists($menu,'toHtml')) {
90 $tmp.=$menu->toHtml();
93 trigger_error('El metodo no existe!', E_USER_WARNING);
102 foreach ($body as $bod) {
103 if (is_object($bod)) {
104 if (method_exists($bod,'toHtml')) {
105 $tmp.=$bod->toHtml();
108 trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
116 $TABLA->addRow($row);
117 $row = array ($TABLA->toHtml());
118 $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$c.'" valign="top"');
119 //Agrego si corresponde el espacio al final
120 if ($this->_configuracion['espacios']) {
121 $row = array (' ');
122 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');