-<?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: Mon Apr 14 16:23:22 2003
-// | Author: Martin Marrese <mmarre@mecon.gov.ar>
-// +----------------------------------------------------------------------+
-//
-// $Id$
-// $Author$
-// $URL$
-// $Date$
-// $Rev$
-//
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ Ministerio de EconomÃa
+ meconlib
+-------------------------------------------------------------------------------
+This file is part of meconlib.
-#require_once 'PEAR.php';
+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: Mon Apr 14 16:23:22 2003
+Autor: Martin Marrese <mmarre@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
// +X2C includes
-require_once 'Marco/Pagina.php';
+require_once 'MECON/Marco/Pagina.php';
// ~X2C
//Require Agregados por MMARRE, no pasan por el xmi2code
-require_once 'ImagenAnimada.php';
-require_once 'Menu.php';
-require_once 'MenuHorizontal.php';
-require_once 'MenuVertical.php';
-require_once 'MenuOculto.php';
-
+require_once 'MECON/Marco/ImagenAnimada.php';
+require_once 'MECON/Marco/Menu.php';
+require_once 'MECON/Marco/MenuHorizontal.php';
+require_once 'MECON/Marco/MenuVertical.php';
+require_once 'MECON/Marco/MenuOculto.php';
// +X2C Class 16 :Seccion
/**
* Clase seccion para el manejo de las secciones
*
+ * @package MECON_Marco
* @access public
*/
class Seccion extends Pagina {
var $_tipoMenu;
/**
- * Lugar en donde esta el sistema.
+ * Array con la configuracion del sistema
*
- * @var string $directorio
+ * @var array $configuracion
* @access private
*/
- var $_directorio;
+ var $_configuracion;
/**
* @var string $menuHtml
* Constructor. Recibe como parametro el nombre de la seccion
*
* @param array $seccion Array con la informacion de la seccion
- * @param string $directorio Dir en donde esta el sistema
+ * @param array $configuracion Array con la configuracion del sistema
*
* @return void
* @access public
* @static
*/
- function Seccion($seccion, $directorio) // ~X2C
+ function Seccion($seccion, $configuracion) // ~X2C
{
- if (array_key_exists('nombre',$seccion)) {
- $this->_nombre = $seccion['nombre'];
- }
-
- if (array_key_exists('imagenComun' ,$seccion))
- $imgComun =$seccion['imagenComun'];
- else
- unset($imgComun);
- if (array_key_exists('imagenMouseOn',$seccion))
- $imgMouseOn=$seccion['imagenMouseOn'];
- else
- unset($imgMouseOn);
- if (array_key_exists('imagenSelect' ,$seccion))
- $imgSelect =$seccion['imagenSelect'];
- else
- unset($imgSelect);
- $this->_imagen = new ImagenAnimada($imgComun,$imgMouseOn,$imgSelect);
-
- if (array_key_exists('tipoMenu',$seccion)) {
- $this->_tipoMenu = $seccion['tipoMenu'];
- }
- if (!is_null($directorio)) {
- $this->_directorio = $directorio;
- }
- if (array_key_exists('link',$seccion)) {
+ $this->_nombre = @strval($seccion['nombre']);
+ $imgComun = @strval($seccion['imagenComun']);
+ $imgMouseOn = @strval($seccion['imagenMouseOn']);
+ $imgSelect = @strval($seccion['imagenSelect']);
+ $this->_tipoMenu = @strval($seccion['tipoMenu']);
+ if (@$seccion['link']) {
parent::Pagina($seccion['link']);
}
- if (array_key_exists('hijos',$seccion)) {
+ $this->_imagen = new ImagenAnimada($imgComun, $imgMouseOn, $imgSelect,
+ $configuracion['directorios']['imagenes'], $this->_nombre,
+ $configuracion['directorios']['root'].'/'.$this->_link);
+ if (!is_null($configuracion)) {
+ $this->_configuracion = $configuracion;
+ }
+ if (array_key_exists('hijos', $seccion)) {
$this->_cargarHijos($seccion['hijos']);
}
}
function toHtml($link_sel) // ~X2C
{
if (isset($_SESSION['deshabilitar_links']) && $_SESSION['deshabilitar_links']) {
- $link_start = '';
- $link_end = '';
- $link_start2 = '';
+ $this->_imagen->setHabilitada(false);
}
- else {
- $link_start = '<a href="'.$this->_link.'">';
- $link_start2 = '<a href="'.$this->_link.'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_displayStatusMsg(\''.$this->_nombre.'\'); MM_swapImage(\''.$this->_nombre.'\',\'\',\''.$this->_imagen->_imgMouseOn.'\',1); return document.MM_returnValue" MM_swapImage(\''.$this->_nombre.'\',\'\',\''.$this->_imagen->_imgMouseOn.'\',1)>';
- $link_end = '</a>';
- }
-
if ($this->verifSeccionSeleccionada($link_sel)) {
- $sec = $link_start."<img name=\"".$this->_nombre."\" src=\"".$this->_imagen->_imgSelect."\" border=\"0\" alt=\"".$this->_imagen->_alt."\">".$link_end;
- }
- else {
- $sec = $link_start2."<img name=\"".$this->_nombre."\" src=\"".$this->_imagen->_imgComun."\" border=\"0\" alt=\"".$this->_imagen->_alt."\">".$link_end;
+ $this->_imagen->setSeleccionada(true);
}
-
- return $sec;
+ return $this->_imagen->toHtml();
}
// -X2C
function _cargarHijos($hijos) // ~X2C
{
if ($this->_tipoMenu == 'vertical'){
- $tmp = new MenuVertical($this->_directorio);
+ $tmp = new MenuVertical($this->_configuracion);
}
elseif ($this->_tipoMenu == 'horizontal') {
- $tmp = new MenuHorizontal($this->_directorio);
+ $tmp = new MenuHorizontal($this->_configuracion);
}
else {
- $tmp = new MenuOculto($this->_directorio);
+ $tmp = new MenuOculto($this->_configuracion);
}
foreach ($hijos as $hijo) {
$tmp->agregarComponente($hijo);
*/
function _desSerializarArraySecciones() // ~X2C
{
- $tmp = PRE_DIR.$this->_directorio.POST_DIR.ARRAYSECCIONES_SERIALIZADO;
-
+ $file_cache = strtr($this->_configuracion['directorios']['root'],'/','_');
+ $tmp = $this->_configuracion['directorios_fs']['cache'].'/'.ARRAYSECCIONES_SERIALIZADO.'_'.$file_cache;
+
if (file_exists($tmp)) {
$s = implode("", @file($tmp));
return unserialize($s);
$link_end = '';
}
else {
- $link_start = '<a href="'.$this->_link.'" style="'.$style.'">';
+ $link_start = '<a href="'.$this->_configuracion['directorios']['root'].'/'.$this->_link.'" style="'.$style.'">';
$link_end = '</a>';
}
$sec = array ();
if ($this->verifSeccionSeleccionada($link_sel)) {
if ($ultimo) {
- $sec[] = $link_start.'<img src="/www/images/carp2_f3" border="0">'.$link_end;
+ $sec[] = $link_start.'<img src="/MECON/images/general_carp2_f3" border="0">'.$link_end;
}
else {
- $sec[] = $link_start.'<img src="/www/images/carp1_f3" border="0">'.$link_end;
+ $sec[] = $link_start.'<img src="/MECON/images/general_carp1_f3" border="0">'.$link_end;
}
}
else {
if ($ultimo) {
- $sec[] = $link_start.'<img src="/www/images/carp2_f2" border="0">'.$link_end;
+ $sec[] = $link_start.'<img src="/MECON/images/general_carp2_f2" border="0">'.$link_end;
}
else {
- $sec[] = $link_start.'<img src="/www/images/carp1_f2" border="0">'.$link_end;
+ $sec[] = $link_start.'<img src="/MECON/images/general_carp1_f2" border="0">'.$link_end;
}
}