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 103 :MenuVertical
36 * Clase que se encarga del manejo de los menues verticales
38 * @package MECON_Marco
41 class MenuVertical extends Menu {
47 * Constructor. Recibe el nombre del directorio en donde esta instalado el sistema
49 * @param array $configuracion Configuracion del sistema
54 function MenuVertical($configuracion = null) // ~X2C
56 parent::Menu($configuracion);
62 * Funcion para agregar el cuerpo de la pagina a la pagina
64 * @param string $body Cuerpo del mensaje 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);
76 $tmp = $this->_componentes;
77 $this->_componentes = array ();
78 $this->_armarArraySecciones($tmp);
80 $TABLA = new HTML_Table('width=160 align="left" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0" height="1"');
82 $menu ='<img src="/MECON/images/general_carpeta0" border="0"> <font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>'.$titulo.'</b></font>';
84 $TABLA->addRow($row,'align="left" bgcolor="#FFFFFF" height="1"');
85 $TABLA->updateCellAttributes(0,0,'colspan="2"');
87 foreach ($this->_componentesVertical as $comp) {
88 $row = array ('<img src="/MECON/images/general_carp" border="0">',' ');
90 $TABLA->addRow($comp,'align="left" bgcolor="#FFFFFF" height="1"');
91 $TABLA->updateColAttributes(0,'align="right" width="34"');
92 $TABLA->updateColAttributes(1,'align="left"');
94 $TABLA->updateCellAttributes(0,0,'align="left"');
95 $row = array ($TABLA->toHtml());
97 $this->_tabla->addRow($row,'width=160 align="left" bgcolor="#FFFFFF" valign="top"');
101 //Agrego si corresponde el espacio al inicio
107 foreach ($body as $bod) {
108 if (is_object($bod)) {
109 if (method_exists($bod,'toHtml')) {
110 $tmp.=$bod->toHtml();
113 trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
120 //Agrego si corresponde el espacio al final
126 $this->_tabla->setCellContents (0,1,$row);
127 $this->_tabla->setCellAttributes(0,1,'align="center" bgcolor="#FFFFFF" valign="top"');
129 $this->_tabla->updateColAttributes (1,'width="600"');
134 } // -X2C Class :MenuVertical