/**
* 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
/**
# 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
/**
// add a required note, if one is needed
if (!empty($form->_required) && !$form->_freezeAll) {
$id = $this->_tabla->addRow(
- array($form->getRequiredNote()),
- array('colspan' => 2, 'align' => 'center', 'cabecera' => true)
+ array('<font size="-2">'.$form->getRequiredNote().'</font>'),
+ array('colspan' => 2, 'cabecera' => true)
);
//$this->_tabla->updateCellAttributes($id, array('colspan' => 2));
}
$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
/**
$name = $header->getName();
$this->_tabla->addRow(
array($header->toHtml()),
- array('colspan' => 2, $name => true, 'align' => 'center')
+ array('colspan' => 2, $name => true)
);
} // end func renderHeader
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;
+ }
+
+ function getCSS() {
+ return $this->_tabla->getCSS();
+ }
} // end class HTML_QuickForm_Renderer_Default