From 236b889143086644d268f8066a143b9af95f639e Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 6 Jun 2003 21:04:25 +0000 Subject: [PATCH] Se cambian los parametros de configuracion por arrays para simplificar la mezcla de atributos. --- HTML/php/Tabla.php | 24 ++++++++++---------- HTML/php/Tabla/conf_Tabla.php | 41 ++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/HTML/php/Tabla.php b/HTML/php/Tabla.php index c348232..30ab34a 100644 --- a/HTML/php/Tabla.php +++ b/HTML/php/Tabla.php @@ -263,7 +263,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 +347,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 +357,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 +371,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; } diff --git a/HTML/php/Tabla/conf_Tabla.php b/HTML/php/Tabla/conf_Tabla.php index 3c7cbbb..bd483ee 100644 --- a/HTML/php/Tabla/conf_Tabla.php +++ b/HTML/php/Tabla/conf_Tabla.php @@ -19,14 +19,39 @@ // $Author$ return array ( - 'atributos' => array ( - 'tabla_comun' => 'width="100%" align="center" cellpadding="0" cellspacing="2" border="0" bgcolor="#336699"', - 'tabla_contenedora'=> 'width="100%" align="center" cellpadding="0" cellspacing="0" border="0" bgcolor="#336699"', - 'celda_cabecera'=> 'align="center" bgcolor="#336699" class="texto11_blanco"', - - 'celda_comun' => 'align="center" bgcolor="#FFFFFF" class="texto11_negro"', - 'celda_titulo' => 'align="center" bgcolor="#DDEEFF" class="texto11_negro"', - ), + 'atributos' => array ( + 'tabla_comun' => array( + 'width' => '100%', + 'align' => 'center', + 'cellpadding' => 0, + 'cellspacing' => 2, + 'border' => 0, + 'bgcolor' => '#336699', + ), + 'tabla_contenedora' => array( + 'width' => '100%', + 'align' => 'center', + 'cellpadding' => 0, + 'cellspacing' => 0, + 'border' => 0, + 'bgcolor' => '#336699', + ), + 'celda_cabecera' => array( + 'align' => 'center', + 'bgcolor' => '#336699', + 'class' =>'texto11_blanco', + ), + 'celda_comun' => array( + 'align' => 'center', + 'bgcolor' => '#FFFFFF', + 'class' => 'texto11_negro', + ), + 'celda_titulo' => array( + 'align' => 'center', + 'bgcolor' => '#DDEEFF', + 'class' => 'texto11_negro', + ), + ), ); ?> -- 2.43.0