1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
4 -------------------------------------------------------------------------------
5 This file is part of mlib.
7 mlib is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your option)
12 mlib is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License; if not,
17 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------
20 Creado: mié jun 18 15:08:05 ART 2003
21 Autor: Leandro Lucarella <llucar@mecon.gov.ar>
22 -------------------------------------------------------------------------------
24 -----------------------------------------------------------------------------*/
26 require_once 'HTML/QuickForm.php';
29 * QuickForm de uso general del MECON.
31 class MLIB_HTML_QuickFormSimple extends HTML_QuickForm {
33 function MLIB_HTML_QuickFormSimple($formName='', $method='post', $action='', $target='_self', $attributes=null)
35 parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
36 $this->registerElementType('mdate', 'MLIB/HTML/QuickForm/mdate.php', 'MLIB_HTML_QuickForm_mdate');
37 $this->registerRule('fecha', 'function', 'validate', 'MLIB_HTML_QuickForm_mdate');
38 $this->registerElementType('caritas', 'MLIB/HTML/QuickForm/caritas.php', 'MLIB_HTML_QuickForm_caritas');
39 $this->setRequiredNote('<font color="red">*</font> indica un campo obligatorio');
40 $this->setJsWarnings('Hay errores en el formulario:', 'Por favor corríjalos antes de continuar.');
44 * Igual que QuickForm pero pone por default validación en el cliente además
47 function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
49 parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
53 * Igual que QuickForm pero pone por default validación en el cliente además
56 function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
58 parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
62 * Obtiene el inicio del formulario.
68 $attrs = $this->getAttributes(true);
69 return "<form$attrs>";
73 * Obtiene el fin del formulario.