X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/56c363442764a21af0820b0e3dd6e9b771119abf..b371ffddb6dbdf292f496845e4b27d83bd70fa3f:/lib/MECON/HTML/QuickForm/Renderer/Tabla.php diff --git a/lib/MECON/HTML/QuickForm/Renderer/Tabla.php b/lib/MECON/HTML/QuickForm/Renderer/Tabla.php index a767a19..79c3f14 100644 --- a/lib/MECON/HTML/QuickForm/Renderer/Tabla.php +++ b/lib/MECON/HTML/QuickForm/Renderer/Tabla.php @@ -88,14 +88,20 @@ class MECON_HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer { /** * Constructor. * - * @param mixed $style Estilo de la tabla. + * @param mixed $param Array o sting con el estilo de la tabla u objeto + * tabla alternativo para usar. * * @access public */ - function MECON_HTML_QuickForm_Renderer_Tabla($style = array()) + function MECON_HTML_QuickForm_Renderer_Tabla($param = array()) { $this->HTML_QuickForm_Renderer(); - $this->_tabla =& new Tabla($style); + if (is_a($param, 'Tabla')) { + $this->setTable($param); + } + else { + $this->_tabla =& new MECON_HTML_Tabla($param); + } } // end constructor /** @@ -123,7 +129,7 @@ class MECON_HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer { # FIXME - deberia sacarlo del QuickForm #$this->_prepend = $form->getFormStart(); $attrs = $form->getAttributesString(); - $this->_prepend = "\n
\n"; + $this->_append = "\n\n"; } // end func finishForm /** @@ -165,7 +171,7 @@ class MECON_HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer { $name = $header->getName(); $this->_tabla->addRow( array($header->toHtml()), - array('colspan' => 2, $name => true, 'align' => 'center') + array('colspan' => 2, $name => true) ); } // end func renderHeader @@ -184,8 +190,8 @@ class MECON_HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer { if (!$this->_inGroup) { $id = $this->_tabla->addRow( array( - $element->getLabel() . ($required ? '*' : ''), - $element->toHtml() . ($error ? "