X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/fec9433041fde792aecee7e8456c1e79b1c16f4f..83f5ca1886eca8af58874f3a9967ab1d5dbf5b18:/lib/MECON/HTML/Tabla.php diff --git a/lib/MECON/HTML/Tabla.php b/lib/MECON/HTML/Tabla.php index 14147b0..035e4f4 100644 --- a/lib/MECON/HTML/Tabla.php +++ b/lib/MECON/HTML/Tabla.php @@ -287,7 +287,7 @@ class MECON_HTML_Tabla extends HTML_Table { */ function updateCellAttributes($row, $col, $attrs) { - return parent::updateCellAttributes($row, $col, $this->_translateAttributes($attrs)); + return parent::updateCellAttributes($row, $col, $this->_translateAttributes($attrs, false)); } /** @@ -305,7 +305,7 @@ class MECON_HTML_Tabla extends HTML_Table { */ function setCellAttributes($row, $col, $attrs) { - return parent::setCellAttributes($row, $col, $this->_translateAttributes($attrs)); + return parent::setCellAttributes($row, $col, $this->_translateAttributes($attrs, true)); } /** @@ -332,12 +332,13 @@ class MECON_HTML_Tabla extends HTML_Table { * Convierte un atributo HTML al string para pasar a los metodos de HTML_Table * Recibe en $attrs los atributos a modificar. * - * @param string $attrs Atributos + * @param mixed $attrs Atributos. + * @param bool $isSet Indica si hay que setear. * - * @return string + * @return array * @access private */ - function _translateAttributes($attrs) + function _translateAttributes($attrs, $isSet) { if (!$attrs) { return array(); @@ -345,9 +346,11 @@ class MECON_HTML_Tabla extends HTML_Table { if (is_string($attrs)) { $attrs = $this->_parseAttributes($attrs); } - #$rta = array(); - $rta = $this->_conf['atributos']['celda_comun']; - #$sin_estilo = true; + if ($isSet) { + $rta = $this->_conf['atributos']['celda_comun']; + } else { + $rta = array(); + } foreach ($attrs as $attr => $val) { $attr = strtolower($attr); switch ($attr) { @@ -355,7 +358,6 @@ class MECON_HTML_Tabla extends HTML_Table { case 'comun': case 'cabecera': case 'titulo': - #$sin_estilo = false; $rta = array_merge($rta, $this->_conf['atributos']["celda_$attr"]); break; case 'align': @@ -383,10 +385,6 @@ class MECON_HTML_Tabla extends HTML_Table { 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']; - #} return $rta; }