-<?php
-// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2003 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available at through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Created: Thu May 15 18:36:01 2003
-// | Author: Martin Marrese <mmarre@mecon.gov.ar>
-// +----------------------------------------------------------------------+
-//
-// $Id$
-// $Author$
-// $URL$
-// $Date$
-// $Rev$
-//
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4:
+-------------------------------------------------------------------------------
+ Ministerio de EconomÃa
+ meconlib
+-------------------------------------------------------------------------------
+This file is part of meconlib.
+
+meconlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+meconlib is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License; if not,
+write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Creado: Thu May 15 18:36:01 2003
+Autor: Martin Marrese <mmarre@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
-#require_once 'PEAR.php';
require_once 'HTML/Table.php';
+require_once 'MECON/HTML/Image.php';
// +X2C includes
require_once 'MECON/Marco/MenuHorizontal.php';
// ~X2C
-// +X2C Class 193 :MenuPrincipal
+// +X2C Class 193 :MECON_Marco_MenuPrincipal
/**
- * Clase que se encarga del manejo de los menues principales. Este menu es el de secciones general del sistema.
+ * Clase que se encarga del manejo del menu principal. Este menu es el de secciones general del sistema.
*
* @package MECON_Marco
* @access public
*/
-class MenuPrincipal extends MenuHorizontal {
+class MECON_Marco_MenuPrincipal extends MECON_Marco_MenuHorizontal {
/**
* Contiene el objeto seccion que se encuentra seleccionada. Se utiliza para mostrar el menu.
*
* @var Seccion $seccionSeleccionada
* @access private
*/
- var $_seccionSeleccionada;
+ var $_seccionSeleccionada = null;
// ~X2C
* @return void
* @access public
*/
- function menuPrincipal($configuracion) // ~X2C
+ function MECON_Marco_MenuPrincipal($configuracion) // ~X2C
{
- $this->_seccionSeleccionada = null;
- parent::Menu($configuracion);
+ parent::MECON_Marco_Menu($configuracion);
if (!is_null($configuracion['secciones'] || $configuracion['secciones'] == '')) {
$this->_armarArraySecciones($this->_obtenerConfSecciones());
function addBody($body) // ~X2C
{
$colspan = count($this->_componentes);
-
- $row = array ($body['copete']);
- $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"');
+
+ //Agrego el copete {{{
+ $copete = new MECON_Marco_Copete ($this->_configuracion['directorios']['imagenes'],
+ @$this->_configuracion['ayuda'], $this->_configuracion['titulo_sistema']);
+ $row[] = $copete->toHtml();
+ $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF"');
+ //}}}
//Agrego las secciones
- $this->_tabla->addRow($this->_componentes,'align="center" bgcolor="#CCCCCC"');
- $colcount = $this->_tabla->getColCount();
- $width = 100 / $colcount;
+ $TABLAM = new HTML_Table('width=760
+ align="center"
+ cellspacing="0"
+ cellpadding="0"
+ border="0"
+ background="/MECON/images/general_fondo_gris.gif"');
+ $TABLAM->addRow($this->_componentes,'align="center" bgcolor="#CCCCCC"');
+ $width = intval (100 / $colspan);
- for ($col=0; $col < $colcount; $col++) {
- $this->_tabla->updateColAttributes($col,'width="'.$width.'%"');
- }
+ for ($col=0; $col < $colspan; $col++) {
+ $TABLAM->updateCellAttributes(0,$col,'width="'.$width.'%"');
+ }
+ $this->_tabla->addRow(array($TABLAM));
+ $imagen = new MECON_HTML_Image('/MECON/images/general_linea.gif', str_repeat('=', 108));
+ $i = $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center"');
+ $this->_tabla->updateRowAttributes($i, 'height="1"');
+
foreach ($this->_secciones as $sec) {
if ($sec->verifSeccionSeleccionada($_SERVER['PHP_SELF'])) {
$this->_seccionSeleccionada = $sec;
}
//Agrego el contenido de la pagina
if (!is_null($this->_seccionSeleccionada) && isset($this->_seccionSeleccionada->_hijos)) {
- $this->_seccionSeleccionada->_hijos->addBody($body['body'],$this->_seccionSeleccionada->_nombre, $body['espacios'], $body['menuVertical']);
+ $this->_seccionSeleccionada->_hijos->addBody($body['body'],$this->_seccionSeleccionada->_nombre, $body['menuVertical']);
$row = array ($this->_seccionSeleccionada->_hijos->toHtml());
- $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"');
+ $this->_tabla->addRow($row,'align="center" bgcolor="#FFFFFF"');
}
else {
- $row = array ('<font face="Arial, Helvetica, sans-serif" size="3" color="#FFFFFF"><b>'.$this->_seccionSeleccionada->_nombre.'</b></font>');
- $this->_tabla->addRow($row,'align="left" bgcolor="#336699" colspan="'.$colspan.'"');
+ if ($this->_seccionSeleccionada) {
+ $row = array ($this->_armarEncabezado($this->_seccionSeleccionada->_nombre.$this->_configuracion['subtitulo']));
+ $this->_tabla->addRow($row,'align="left" bgcolor="#FFFFFF"');
+ $imagen = new MECON_HTML_Image('/MECON/images/general_linea2.gif',
+ str_repeat('-', 108), array('border' => 0, 'align' => 'center'));
+ $this->_tabla->addRow(array ($imagen->toHtml()), 'align="center"');
+ }
- $tabla = new HTML_Table (array('width' => '760', 'border' => 0, 'celspacing' => 0, 'celpadding' => 0));
//Agrego si corresponde el espacio al inicio
- if ($body['espacios']) {
+ if ($this->_configuracion['espacios']) {
$espacio = ' <BR>';
}
else {
$espacio = '';
}
//
+
+//SI HAY MENU ARMO UNA TABLA, SINO TIRO DIRECTAMENTE
$row = array();
$tmp = '';
if ($body['menuVertical']) {
if (is_object($body['menuVertical'])) {
if (method_exists($body['menuVertical'],'toHtml')) {
$tmp.=$body['menuVertical']->toHtml();
- }
- else {
+ } else {
trigger_error('El metodo no existe!', E_USER_WARNING);
}
- }
- else {
+ } else {
$tmp.=$body['menuVertical'];
}
$row[] = $tmp;
if (is_object($bod)) {
if (method_exists($bod,'toHtml')) {
$tmp.=$bod->toHtml();
+ } else {
+ trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
}
- else {
- trigger_error('El metodo no existe! - '.get_class($bod).'::toHtml()', E_USER_WARNING);
- }
- }
- else {
+ } else {
$tmp.=$bod;
}
}
$tmp.= $espacio;
$row[] = $tmp;
- }
- else {
+ } else {
$row[] = $body['body'];
}
- $tt = $tabla->addRow($row,'align="center" bgcolor="#FFFFFF"');
if ($body['menuVertical']) {
+ $tabla = new HTML_Table (array('width' => '760', 'border' => 0, 'celspacing' => 0, 'celpadding' => 0));
+ $tt = $tabla->addRow($row,'align="center" bgcolor="#FFFFFF" valign="top"');
$tabla->updateCellAttributes($tt, 0, 'valign="top" width="1%"');
+ $contenido[] = $tabla;
+ } else {
+ $contenido = $row;
}
- $this->_tabla->addRow(array($tabla->toHtml()),'align="center" bgcolor="#FFFFFF" colspan="'.$colspan.'"');
-
+//
+ $this->_tabla->addRow($contenido,'align="center" bgcolor="#FFFFFF" valign="top"');
}
- $row = array ($body['pie']);
- $this->_tabla->addRow($row,'align="center" bgcolor="#CCCCCC" colspan="'.$colspan.'"');
}
// -X2C
-} // -X2C Class :MenuPrincipal
+} // -X2C Class :MECON_Marco_MenuPrincipal
-?>
+?>
\ No newline at end of file