2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Created: Tue Apr 29 12:35:45 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
27 #require_once 'PEAR.php';
31 require_once 'MECON/Marco/Menu.php';
34 // +X2C Class 100 :MenuHorizontal
36 * Clase que se encarga del manejo de los menues horizontales
38 * @package MECON_Marco
41 class MenuHorizontal extends Menu {
47 * Constructor. Recibe el nombre del directorio en donde esta instalado el sistema
49 * @param array $configuracion Configuracion del sistema
54 function MenuHorizontal($configuracion = null) // ~X2C
56 parent::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 :MenuHorizontal