-<?php
-// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
-// +--------------------------------------------------------------------+
-// | HTML - TABLE |
-// +--------------------------------------------------------------------+
-// | Libreria para la estandarizacion de los elementos html de los |
-// | de la Intranet |
-// | Ministerio de EconomÃa |
-// +--------------------------------------------------------------------+
-// | Creado: fri mar 21 ART 2003 |
-// | Autor: Martin Marrese <mmarre@mecon.gov.ar> |
-// +--------------------------------------------------------------------+
-//
-// $Id$
-//
-// $URL$
-// $Rev$
-// $Date$
-// $Author$
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ 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: fri mar 21 ART 2003
+Autor: Martin Marrese <mmarre@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
require_once 'HTML/Table.php';
* quieren dar a la tabla en cuestion. Estos atributos estan
* seteados por default segun el archivo de configuracion.
*
- * @param $atributos Atributos diferentes a los estandares para la
+ * @param mixed $atributos Atributos diferentes a los estandares para la
* tabla
+ * @param string $estilo Tipo de tabla. (comun, servicio)
*
* @access public
*/
- function Tabla($attrs = null)
+ function Tabla($attrs = null, $estilo = 'comun')
{
- $this->_conf = include 'Tabla/conf_Tabla.php'; // Obtengo los valores particulares de configuracion
+ $this->_conf = include 'MECON/HTML/Tabla/estilo_'.$estilo.'.php'; // Obtengo los valores particulares de configuracion
// Seteo los atributos para la tabla
$this->_attrs = $this->_conf['atributos']['tabla_comun'];
//Genero el objeto HTML_Table
function toHtml($simple = 0)
{
// Agregar la tabla de fondo.
- if ($simple == 0) {
- $tmp = $this->_parseAttributes($this->_conf['atributos']['tabla_contenedora']);
- $tmp['width'] = $this->_attrs['width'];
- $tabla_externa = new HTML_Table($tmp);
- $tabla_externa->setCellContents(0, 0, parent::toHtml());
- $tabla_externa->setCellAttributes(0, 0, $this->_conf['atributos']['celda_contenedora']);
- $result = $tabla_externa->toHtml();
- }
- else {
+ if ($simple) {
$result = parent::toHtml();
+ } else {
+ $contenedora = $this->_conf['atributos']['tabla_contenedora'];
+ $contenedora['width'] = $this->getAttribute('width');
+ $this->updateAttributes(array('width' => '100%'));
+ $tabla_externa = new HTML_Table($contenedora);
+ $tabla_externa->addRow(array(parent::toHtml()),
+ $this->_conf['atributos']['celda_contenedora']);
+ $result = $tabla_externa->toHtml();
}
return $result;
case 'border':
case 'cellspacing':
case 'cellpadding':
+ case 'nowrap':
$rta[$attr] = $val;
break;
case 'spacing':
case 'padding':
$rta["cell$attr"] = $val;
break;
- case 'nowrap':
case 'th':
$rta[$attr] = '';
break;