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';
29 require_once 'MECON/HTML/QuickForm/Renderer/Tabla_Servicios.php';
32 * QuickForm de uso general del MECON.
34 class MECON_HTML_QuickForm extends HTML_QuickForm {
35 var $_rendererOpts = array();
36 var $_renderer = 'MECON_HTML_QuickForm_Renderer_Tabla()';
37 function MECON_HTML_QuickForm($formName='', $method='post', $action='', $target='_self', $attributes=null)
39 parent::HTML_QuickForm($formName, $method, $action, $target, $attributes);
40 $this->registerElementType('mdate', 'MECON/HTML/QuickForm/mdate.php', 'HTML_QuickForm_mdate');
41 $this->registerRule('fecha', 'function', 'validate', 'HTML_QuickForm_mdate');
42 $this->setRequiredNote('<FONT color="red">*</FONT> indica un campo obligatorio');
43 $this->setJsWarnings('Hay errores en el formulario:', 'Por favor corríjalos antes de continuar.');
45 function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
47 parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
49 function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
51 parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
56 $renderer =& new $this->_renderer ($this->_rendererOpts);
58 $this->accept($renderer);
59 return $renderer->toHtml();
61 function setRendererOpts($opts) {
62 $this->_rendererOpts = $opts;
64 function getRendererOpts($opts) {
65 return $this->_rendererOpts;;
67 function updateRendererOpts($opts) {
68 $this->_rendererOpts = array_merge($this->_rendererOpts, $opts);
71 //AGREGADO POR mmarre PARA PODER DECIDIR CUAL DE NUESTROS RENDERES UTILIZAR
72 //Por defecto utiliza el renderer que deja las tablas como estaban en un
74 function setRenderer($renderer = 'MECON_HTML_QuickForm_Renderer_Tabla') {
75 $this->_renderer = $renderer.'()';