//
require_once 'HTML/QuickForm.php';
+require_once 'MECON/HTML/QuickForm/Renderer/Tabla.php';
/**
* QuickForm de uso general del MECON.
*/
class MECON_HTML_QuickForm extends HTML_QuickForm {
+ var $_rendererOpts = array();
function MECON_HTML_QuickForm($formName='', $method='post', $action='', $target='_self', $attributes=null)
{
parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
{
parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
}
+ function toHtml() {
+ $renderer =& new MECON_HTML_QuickForm_Renderer_Tabla($this->_rendererOpts);
+ $this->accept($renderer);
+ return $renderer->toHtml();
+ }
+ function setRendererOpts($opts) {
+ $this->_rendererOpts = $opts;
+ }
+ function getRendererOpts($opts) {
+ return $this->_rendererOpts;;
+ }
+ function updateRendererOpts($opts) {
+ $this->_rendererOpts = array_merge($this->_rendererOpts, $opts);
+ }
}
?>
*
* @access public
*/
-class HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer {
+class MECON_HTML_QuickForm_Renderer_Tabla extends HTML_QuickForm_Renderer {
/**
* Tabla usada para dibujar el formulario.
*
* @access public
*/
- function HTML_QuickForm_Renderer_Tabla($style = array('width' => '100%'))
+ function MECON_HTML_QuickForm_Renderer_Tabla($style = array())
{
$this->HTML_QuickForm_Renderer();
$this->_tabla =& new Tabla($style);
// Agregar la tabla de fondo.
if ($simple == 0) {
$tmp = $this->_parseAttributes($this->_conf['atributos']['tabla_contenedora']);
- $tmp['width'] = $this->_attrs['width'];
- $tabla_externa = new HTML_Table($tmp);
+ $tabla_externa = new HTML_Table(array('width' => '100%'));
$tabla_externa->setCellContents(0, 0, parent::toHtml());
$tabla_externa->setCellAttributes(0, 0, $this->_conf['atributos']['celda_contenedora']);
$result = $tabla_externa->toHtml();
<HTML>
<HEAD>
<TITLE>Prueba de renderer</TITLE>
- <LINK rel="stylesheet" href="/www/css/estilos.css" type="text/css"/>
+ <LINK rel="stylesheet" href="/MECON/css/general_estilos.css" type="text/css"/>
</HEAD>
<BODY>
<?
require_once 'MECON/HTML/QuickForm.php';
- require_once 'MECON/HTML/QuickForm/Renderer/Tabla.php';
$form = new MECON_HTML_QuickForm('test');
echo 'Aca Meto el Proceso de grabacion, eliminacion, etc';
}
- $renderer =& new HTML_QuickForm_Renderer_Tabla();
- $form->accept($renderer);
- echo $renderer->toHtml();
+ echo $form->toHtml();
?>
</BODY>