+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
+// +--------------------------------------------------------------------+
+// | Ministerio de Economía |
+// | Intranet |
+// +--------------------------------------------------------------------+
+// | This file is part of Intranet. |
+// | |
+// | Intranet 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. |
+// | |
+// | Intranet 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 |
+// | along with Hooks; if not, write to the Free Software Foundation, |
+// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +--------------------------------------------------------------------+
+// | Creado: Mon Nov 3 16:53:37 2003 |
+// | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
+// +--------------------------------------------------------------------+
+//
+// $Id: xmi2code.tpl.php 2 2003-06-23 18:29:20Z gmeray $
+//
+
+require_once 'MECON/HTML/Image.php';
+
+
+// +X2C includes
+require_once 'HTML/Table.php';
+// ~X2C
+
+// +X2C Class 180 :HTML_Mensaje
+/**
+ * Clase para mostrar mensajes en Intranet.
+ *
+ * @package sistema_local_lib
+ * @access public
+ */
+class HTML_Mensaje extends HTML_Table {
+ /**
+ * @var string $img
+ * @access private
+ */
+ var $_img;
+
+ /**
+ * @var int $ancho
+ * @access private
+ */
+ var $_ancho;
+
+ /**
+ * @var string $texto
+ * @access private
+ */
+ var $_texto;
+
+ // ~X2C
+
+ // +X2C Operation 181
+ /**
+ * Constructor.
+ *
+ * @param string $tipo Tipo de mensaje.
+Puede ser: 'error', 'ok', 'alerta'.
+ * @param string $texto Texto del mensaje.
+ * @param int $ancho Ancho del mensaje.
+ *
+ * @return void
+ * @access public
+ */
+ function HTML_Mensaje($tipo, $texto = null, $ancho = null) // ~X2C
+ {
+ $this->_ancho = (isset($ancho))?$ancho:180;
+
+ switch ($tipo){
+ case 'ok':
+ $this->_img = 'mensaje_ok.gif';
+ $this->_texto = 'Correcto';
+ break;
+ case 'alerta':
+ $this->_img = 'mensaje_alerta.gif';
+ $this->_texto = 'Incorrecto';
+ break;
+ default:
+ //case 'error'
+ $this->_img = 'mensaje_error.gif';
+ $this->_texto = 'No autorizado';
+ break;
+ }
+
+ if (isset($texto)){
+ $this->_texto = $texto;
+ }
+
+ }
+ // -X2C
+
+ // +X2C Operation 182
+ /**
+ * Muestra el mensaje.
+ *
+ * @return string
+ * @access public
+ */
+ function toHtml() // ~X2C
+ {
+ $ancho_msg = $this->_ancho - 45 - 12 - 1;
+
+ //Imgs
+ $IMG_Pixel =& new MECON_HTML_Image('/sistemas/intranet/images/mensaje_pixel.gif', '', array('height'=>'1'));
+ $IMG_Superior =& new MECON_HTML_Image('/sistemas/intranet//images/mensaje_superior.gif');
+ $IMG_Inferior =& new MECON_HTML_Image('/sistemas/intranet//images/mensaje_inferior.gif');
+ $IMG_Derecha =& new MECON_HTML_Image('/sistemas/intranet//images/mensaje_derecha.gif');
+ $IMG_Izquierda =& new MECON_HTML_Image('/sistemas/intranet//images/'.$this->_img);
+ $IMG_Pixel21 =& new MECON_HTML_Image('/sistemas/intranet/images/mensaje_pixel.gif', '', array('height'=>'21'));
+
+
+ $tabla =& new HTML_Table (array('border'=>'0',
+ 'cellpadding'=>'0',
+ 'cellspacing'=>'0',
+ 'width'=>$this->_ancho));
+
+ $tabla->addrow( array($IMG_Pixel->toHtml(), $IMG_Pixel->toHtml(), $IMG_Pixel->toHtml(), $IMG_Pixel->toHtml()),
+ array ('height'=>'1', 'border'=>'0'));
+
+ $tabla->updateColAttributes(0, array('width'=>'45'));
+ $tabla->updateColAttributes(1, array('width'=>$ancho_msg));
+ $tabla->updateColAttributes(2, array('width'=>'12'));
+ $tabla->updateColAttributes(3, array('width'=>'1'));
+
+ $tabla->addrow( array($IMG_Izquierda->toHtml(), $IMG_Superior->toHtml(), $IMG_Derecha->toHtml(), $IMG_Pixel->toHtml()),
+ array ('valign'=>'top'));
+
+ $tabla->addrow( array('', $this->_texto , '', $IMG_Pixel21->toHtml()),
+ array ('valign'=>'top'));
+
+ $tabla->addrow( array('', $IMG_Inferior->toHtml() , '', $IMG_Pixel->toHtml()),
+ array ('valign'=>'top'));
+
+ $tabla->updateCellAttributes(1,0, array('rowspan'=>'3'));
+ $tabla->updateCellAttributes(1,2, array('rowspan'=>'3'));
+
+ $tabla->updateCellAttributes(2, 1, array('background'=>'/sistemas/intranet/images/mensaje_fondo.gif',
+ 'class'=>'mensaje'));
+
+ $tabla->updateCellAttributes(1, 1, array('background'=>'/sistemas/intranet/images/mensaje_superior.gif'));
+ $tabla->updateCellAttributes(3, 1, array('background'=>'/sistemas/intranet/images/mensaje_inferior.gif'));
+
+ return $tabla->toHtml();
+
+ }
+ // -X2C
+
+ // +X2C Operation 187
+ /**
+ * Obtener la hoja de estilos.
+ *
+ * @return string
+ * @access public
+ */
+ function getCSS() // ~X2C
+ {
+ $css = '/sistemas/intranet/css/mensaje.css';
+ return $css;
+ }
+ // -X2C
+
+} // -X2C Class :HTML_Mensaje
+?>
\ No newline at end of file