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';
30 * QuickForm de uso general del MECON.
32 class MECON_HTML_QuickFormSimple extends HTML_QuickForm {
34 function MECON_HTML_QuickFormSimple($formName='', $method='post', $action='', $target='_self', $attributes=null)
36 parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
37 $this->registerElementType('mdate', 'MECON/HTML/QuickForm/mdate.php', 'MECON_HTML_QuickForm_mdate');
38 $this->registerRule('fecha', 'function', 'validate', 'MECON_HTML_QuickForm_mdate');
39 $this->registerElementType('caritas', 'MECON/HTML/QuickForm/caritas.php', 'MECON_HTML_QuickForm_caritas');
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.');
45 * Igual que QuickForm pero pone por default validación en el cliente además
48 function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
50 parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
54 * Igual que QuickForm pero pone por default validación en el cliente además
57 function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
59 parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
63 * Obtiene el inicio del formulario.
69 $attrs = $this->getAttributesString();
70 return "<form$attrs>";
74 * Obtiene el fin del formulario.