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 'PEAR.php';
31 require_once 'MECON/Marco/Menu.php';
34 // +X2C Class 100 :MECON_Marco_MenuHorizontal
36 * Clase que se encarga del manejo de los menues horizontales
38 * @package MECON_Marco
41 class MECON_Marco_MenuHorizontal extends MECON_Marco_Menu {
47 * Constructor. Recibe el nombre del directorio en donde esta instalado el sistema
49 * @param array $configuracion Configuracion del sistema
54 function MECON_Marco_MenuHorizontal($configuracion = null) // ~X2C
56 parent::MECON_Marco_Menu($configuracion);
62 * Funcion para agregar el cuerpo de la pagina a la pagina
64 * @param string $body Body para agregar a la pagina
65 * @param string $titulo Titulo de la seccion seleccionada
66 * @param bool $espacios Indica si hay que agregar espacios antes y despues del body
67 * @param mixed $menu Menu a mostrar
72 function addBody($body, $titulo, $espacios = true, $menu = null) // ~X2C
74 $c = count($this->_componentes);
75 $tit = '<font face="Arial, Helvetica, sans-serif" size="3" color="#FFFFFF"><b>'.$titulo.'</b></font>';
77 $this->_tabla->addRow($row,'align="left" bgcolor="#336699" colspan="'.$c.'"');
79 $tmp = $this->_componentes;
80 $this->_componentes = array ();
81 $this->_armarArraySecciones($tmp);
82 $this->_tabla->addRow($this->_componentes,'align="center" bgcolor="#FFFFFF"');
85 $colcount = $this->_tabla->getColCount();
86 $width = 100 / $colcount;
87 for ($col=0; $col < $colcount; $col++) {
88 $this->_tabla->updateColAttributes($col,'width="'.$width.'%"');
93 //Agrego si corresponde el espacio al inicio
95 $row = array (' ');
96 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
100 foreach ($body as $bod) {
101 if (is_object($bod)) {
102 if (method_exists($bod,'toHtml')) {
103 $tmp.=$bod->toHtml();
106 trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
114 $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$c.'"');
115 //Agrego si corresponde el espacio al final
117 $row = array (' ');
118 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
124 } // -X2C Class :MECON_Marco_MenuHorizontal