1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
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 require_once 'MECON/HTML/Image.php';
36 // +X2C Class 100 :MECON_Marco_MenuHorizontal
38 * Clase que se encarga del manejo de los menues horizontales
40 * @package MECON_Marco
43 class MECON_Marco_MenuHorizontal extends MECON_Marco_Menu {
48 * Funcion para agregar el cuerpo de la pagina a la pagina
50 * @param string $body Body para agregar a la pagina
51 * @param string $titulo Titulo de la seccion seleccionada
52 * @param mixed $menu Menu a mostrar
57 function addBody($body, $titulo, $menu = null) // ~X2C
60 $tmp = $this->_componentes;
61 $this->_componentes = array ();
62 $this->_armarArraySecciones($tmp);
63 $this->_tabla->addRow($this->_componentes,'align="center" bgcolor="#CCCCCC" valign="top"');
64 $c = count($this->_componentes);
66 $colcount = $this->_tabla->getColCount();
67 $width = 100 / $colcount;
68 for ($col=0; $col < $colcount; $col++) {
69 $this->_tabla->updateColAttributes($col,'width="'.$width.'%"');
72 $imagen = new MECON_HTML_Image('/MECON/images/general_linea.gif');
73 $i = $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"');
74 $this->_tabla->updateRowAttributes($i, 'height="1"');
78 $row = array ($this->_armarEncabezado($titulo));
79 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
80 $imagen = new MECON_HTML_Image('/MECON/images/general_linea2.gif', 'boder="0" align="center"');
81 $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center" colspan="'.$c.'"');
86 //Agrego si corresponde el espacio al inicio
87 if ($this->_configuracion['espacios']) {
88 $row = array (' ');
89 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
92 //AGREGO EL MENU VERTICAL
93 $TABLA = new HTML_Table('width=760 align="center" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0"');
97 if (is_object($menu)) {
98 if (method_exists($menu,'toHtml')) {
99 $tmp.=$menu->toHtml();
102 trigger_error('El metodo no existe!', E_USER_WARNING);
111 foreach ($body as $bod) {
112 if (is_object($bod)) {
113 if (method_exists($bod,'toHtml')) {
114 $tmp.=$bod->toHtml();
117 trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
125 $TABLA->addRow($row);
126 $row = array ($TABLA->toHtml());
127 $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$c.'" valign="top"');
128 //Agrego si corresponde el espacio al final
129 if ($this->_configuracion['espacios']) {
130 $row = array (' ');
131 $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF" colspan="'.$c.'"');
137 } // -X2C Class :MECON_Marco_MenuHorizontal