]> git.llucax.com Git - mecon/meconlib.git/blob - lib/MECON/HTML/QuickForm.php
7258df13a7a9d5a8d1cd85be53637fff3921c71a
[mecon/meconlib.git] / lib / MECON / HTML / QuickForm.php
1 <?php
2 // vim: set expandtab tabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // |                      Ministerio de Economía                        |
5 // |                     QuickForm Tabla Renderer                       |
6 // +--------------------------------------------------------------------+
7 // | This file is part of AI.                                           |
8 // |                                                                    |
9 // | This program is free software; you can redistribute it and/or      |
10 // | modify it under the terms of the GNU General Public License as     |
11 // | published by the Free Software Foundation; either version 2 of the |
12 // | License, or (at your option) any later version.                    |
13 // |                                                                    |
14 // | This program is distributed in the hope that it will be useful,    |
15 // | but WITHOUT ANY WARRANTY; without even the implied warranty of     |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   |
17 // | General Public License for more details.                           |
18 // |                                                                    |
19 // | You should have received a copy of the GNU General Public License  |
20 // | along with Hooks; if not, write to the Free Software Foundation,   |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      |
22 // +--------------------------------------------------------------------+
23 // | Creado: Tue Jun 24 16:22:07 2003                                   |
24 // | Autor:  Leandro Lucarella <llucar@mecon.gov.ar>                    |
25 // +--------------------------------------------------------------------+
26 //
27 // $Id$
28 //
29
30 require_once 'HTML/QuickForm.php';
31 require_once 'MECON/HTML/QuickForm/Renderer/Tabla.php';
32
33 /**
34  * QuickForm de uso general del MECON.
35  */
36 class MECON_HTML_QuickForm extends HTML_QuickForm {
37     var $_rendererOpts = array();
38     function MECON_HTML_QuickForm($formName='', $method='post', $action='', $target='_self', $attributes=null)
39     {
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     }
45     function addRule($element, $message, $type, $format='', $validation='client', $reset = false, $force = false)
46     {
47         parent::addRule($element, $message, $type, $format, $validation, $reset, $force);
48     }
49     function addGroupRule($group, $arg1, $type='', $format='', $howmany=0, $validation = 'client')
50     {
51         parent::addGroupRule($group, $arg1, $type, $format, $howmany, $validation);
52     }
53     function toHtml() {
54         $renderer =& new MECON_HTML_QuickForm_Renderer_Tabla($this->_rendererOpts);
55         $this->accept($renderer);
56         return $renderer->toHtml();
57     }
58     function setRendererOpts($opts) {
59         $this->_rendererOpts = $opts;
60     }
61     function getRendererOpts($opts) {
62         return $this->_rendererOpts;;
63     }
64     function updateRendererOpts($opts) {
65         $this->_rendererOpts = array_merge($this->_rendererOpts, $opts);
66     }
67 }
68
69 ?>