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 {
34 var $_rendererOpts = array();
35 function MECON_HTML_QuickForm($formName='', $method='post', $action='', $target='_self', $attributes=null)
37 parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
38 $this->registerElementType('mdate', 'MECON/HTML/QuickForm/mdate.php', 'HTML_QuickForm_mdate');
39 $this->registerRule('fecha', 'function', 'validate', 'HTML_QuickForm_mdate');
40 $this->setRequiredNote('<FONT color="red">*</FONT> indica un campo obligatorio');
41 $this->setJsWarnings('Hay errores en el formulario:', 'Por favor corríjalos antes de continuar.');
43 function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
45 parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
47 function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
49 parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
52 $renderer =& new MECON_HTML_QuickForm_Renderer_Tabla($this->_rendererOpts);
53 $this->accept($renderer);
54 return $renderer->toHtml();
56 function setRendererOpts($opts) {
57 $this->_rendererOpts = $opts;
59 function getRendererOpts($opts) {
60 return $this->_rendererOpts;;
62 function updateRendererOpts($opts) {
63 $this->_rendererOpts = array_merge($this->_rendererOpts, $opts);