1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
5 -------------------------------------------------------------------------------
6 This file is part of meconlib.
8 meconlib is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 meconlib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: mié jun 18 15:08:05 ART 2003
22 Autor: Leandro Lucarella <llucar@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
27 require_once 'HTML/QuickForm.php';
28 require_once 'MECON/HTML/QuickForm/Renderer/Tabla.php';
31 * QuickForm de uso general del MECON.
33 class MECON_HTML_QuickForm extends HTML_QuickForm {
35 var $_rendererOpts = array();
38 function MECON_HTML_QuickForm($formName='', $method='post', $action='', $target='_self', $attributes=null)
40 parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
41 $this->registerElementType('mdate', 'MECON/HTML/QuickForm/mdate.php', 'HTML_QuickForm_mdate');
42 $this->registerRule('fecha', 'function', 'validate', 'HTML_QuickForm_mdate');
43 $this->setRequiredNote('<FONT color="red">*</FONT> indica un campo obligatorio');
44 $this->setJsWarnings('Hay errores en el formulario:', 'Por favor corríjalos antes de continuar.');
46 $this->renderer =& new MECON_HTML_QuickForm_Renderer_Tabla($this->_rendererOpts);
49 function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
51 parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
53 function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
55 parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
59 $this->accept($this->renderer);
60 return $this->renderer->toHtml();
64 * TODO aclarar que usar
65 * $FORM->renderer->updateAttributes()
69 function setRendererOpts($opts) {
70 $this->renderer->setAttributes($opts);
73 * TODO aclarar que usar
74 * $FORM->renderer->updateAttributes()
78 function getRendererOpts() {
79 return $this->renderer->getAttributes();
82 * TODO aclarar que usar
83 * $FORM->renderer->updateAttributes()
87 function updateRendererOpts($opts) {
88 $this->renderer->updateAttributes($opts);