X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/4bc3d716b5960b852b9b66d2aca640b59910410b..ea2811f6466500bc034b1c7a29a8ba75b1b490d4:/HTML/php/Tabla.php?ds=sidebyside diff --git a/HTML/php/Tabla.php b/HTML/php/Tabla.php index c348232..df56c44 100644 --- a/HTML/php/Tabla.php +++ b/HTML/php/Tabla.php @@ -57,31 +57,30 @@ class Tabla extends HTML_Table { * * @access public */ - function Tabla($attrs = '') + function Tabla($attrs = null) { $this->_conf = include 'Tabla/conf_Tabla.php'; // Obtengo los valores particulares de configuracion // Seteo los atributos para la tabla - $this->_attrs = $this->_parseAttributes($this->_conf['atributos']['tabla_comun']); + $this->_attrs = $this->_conf['atributos']['tabla_comun']; //Genero el objeto HTML_Table - if ($attrs != '') { - $tmp = $this->_parseAttributes($attrs); - if (isset($tmp['width'])) { - $this->_attrs['width'] = $tmp['width']; + if (is_string($attrs)) { + $attrs = $this->_parseAttributes($attrs); + } + if (is_array($attrs)) { + if (isset($attrs['width'])) { + $this->_attrs['width'] = $attrs['width']; } - if (isset($tmp['bgcolor'])) { - $this->_attrs['bgcolor'] = $tmp['bgcolor']; + if (isset($attrs['bgcolor'])) { + $this->_attrs['bgcolor'] = $attrs['bgcolor']; } - if (isset($tmp['cellspacing'])) { - $this->_attrs['cellspacing'] = $tmp['cellspacing']; + if (isset($attrs['cellspacing'])) { + $this->_attrs['cellspacing'] = $attrs['cellspacing']; } - if (isset($tmp['cellpadding'])) { - $this->_attrs['cellpadding'] = $tmp['cellpadding']; + if (isset($attrs['cellpadding'])) { + $this->_attrs['cellpadding'] = $attrs['cellpadding']; } } $this->HTML_Table($this->_attrs); - //Modifico los atributos de todas las tablas - //Hay que encontrar o hacer una funcion que setee los atributos para las futuras - //inserciones. } /** @@ -263,7 +262,8 @@ class Tabla extends HTML_Table { $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(),$this->_conf['atributos']['celda_comun']); + $tabla_externa->setCellContents(0, 0, parent::toHtml()); + $tabla_externa->setCellAttributes(0, 0, $this->_conf['atributos']['celda_comun']); $result = $tabla_externa->toHtml(); } else { @@ -346,8 +346,9 @@ class Tabla extends HTML_Table { if (is_string($attrs)) { $attrs = $this->_parseAttributes($attrs); } - $rta = ''; - $sin_estilo = true; + #$rta = array(); + $rta = $this->_conf['atributos']['celda_comun']; + #$sin_estilo = true; foreach ($attrs as $attr => $val) { $attr = strtolower($attr); switch ($attr) { @@ -355,8 +356,8 @@ class Tabla extends HTML_Table { case 'comun': case 'cabecera': case 'titulo': - $sin_estilo = false; - $rta .= $this->_conf['atributos']["celda_$attr"]; + #$sin_estilo = false; + $rta = array_merge($rta, $this->_conf['atributos']["celda_$attr"]); break; case 'align': case 'valign': @@ -369,24 +370,24 @@ class Tabla extends HTML_Table { case 'border': case 'cellspacing': case 'cellpadding': - $rta .= "$attr=\"$val\""; + $rta[$attr] = $val; break; case 'spacing': case 'padding': - $rta .= "cell$attr=\"$val\""; + $rta["cell$attr"] = $val; break; case 'nowrap': case 'th': - $rta .= $attr; + $rta[$attr] = ''; break; default: trigger_error("No se permite setear el atributo $attr", E_USER_ERROR); } } // Si no tiene estilo, agrego estilo comun. - if ($sin_estilo) { - $rta .= $this->_conf['atributos']['celda_comun']; - } + #if ($sin_estilo) { + #$rta = $this->_conf['atributos']['celda_comun']; + #} return $rta; }