/**
* 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 Tabla($param);
+ }
} // end constructor
/**
# FIXME - deberia sacarlo del QuickForm
#$this->_prepend = $form->getFormStart();
$attrs = $form->getAttributesString();
- $this->_prepend = "\n<FORM$attrs>\n";
+ $this->_prepend = "\n<form$attrs>\n";
} // end func startForm
/**
$this->_script = strval($form->getValidationScript());
# FIXME - deberia sacarlo del QuickForm
#$this->_append = $form->getFormEnd();
- $this->_append = "\n</FORM>\n";
+ $this->_append = "\n</form>\n";
} // end func finishForm
/**
if (!$this->_inGroup) {
$id = $this->_tabla->addRow(
array(
- $element->getLabel() . ($required ? '<FONT color="red">*</FONT>' : ''),
- $element->toHtml() . ($error ? "<BR><FONT color=\"red\">$error</FONT>" : ''),
+ $element->getLabel() . ($required ? '<font color="red">*</FONT>' : ''),
+ $element->toHtml() . ($error ? "<br><font color=\"red\">$error</FONT>" : ''),
)
);
- $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left', 'nowrap' => true));
+ $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left'));
$this->_tabla->updateCellAttributes($id, 1, array('align' => 'left'));
} else {
$this->_groupElements[] = ($element->getLabel() ? ($element->getLabel().' ') : '') . $element->toHtml();
array($group->getLabel(), join($sep, $this->_groupElements)),
array('valign' => 'middle', 'align' => 'left')
);
- $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left', 'nowrap' => true));
+ $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left'));
}
$this->_inGroup = false;
} // end func finishGroup
+
+ /**
+ *
+ *
+ * @param mixed $attrs Html attributes
+ * @access public
+ * @return void
+ */
+ function updateAttributes($attrs) {
+ $this->_tabla->updateAttributes($attrs);
+ }
+ /**
+ *
+ *
+ * @param mixed $attrs Html attributes
+ * @access public
+ * @return void
+ */
+ function setAttributes($attrs) {
+ $this->_tabla->setAttributes($attrs);
+ }
+ /**
+ *
+ *
+ * @access public
+ * @return mixed
+ */
+ function getAttributes() {
+ return $this->_tabla->getAttributes();
+ }
+
+ /**
+ *
+ *
+ * @param Tabla $param Objeto tabla alternativo para utilizar
+ *
+ * @access public
+ */
+ function setTable($param) {
+ $this->_tabla =& $param;
+ }
} // end class HTML_QuickForm_Renderer_Default