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. |
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. |
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. |
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 // +--------------------------------------------------------------------+
30 require_once 'HTML/QuickForm.php';
31 require_once 'MECON/HTML/QuickForm/Renderer/Tabla.php';
34 * QuickForm de uso general del MECON.
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)
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');
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);
54 $renderer =& new MECON_HTML_QuickForm_Renderer_Tabla($this->_rendererOpts);
55 $this->accept($renderer);
56 return $renderer->toHtml();
58 function setRendererOpts($opts) {
59 $this->_rendererOpts = $opts;
61 function getRendererOpts($opts) {
62 return $this->_rendererOpts;;
64 function updateRendererOpts($opts) {
65 $this->_rendererOpts = array_merge($this->_rendererOpts, $opts);