2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Author: Alexey Borzov <borz_off@cs.msu.su> |
17 // +----------------------------------------------------------------------+
22 * An abstract base class for QuickForm renderers
24 * The class implements a Visitor design pattern
27 * @author Alexey Borzov <borz_off@cs.msu.su>
29 class HTML_QuickForm_Renderer
36 function HTML_QuickForm_Renderer()
41 * Called when visiting a form, before processing any form elements
43 * @param object An HTML_QuickForm object being visited
48 function startForm(&$form)
51 } // end func startForm
54 * Called when visiting a form, after processing all form elements
56 * @param object An HTML_QuickForm object being visited
61 function finishForm(&$form)
64 } // end func finishForm
67 * Called when visiting a header element
69 * @param object An HTML_QuickForm_header element being visited
74 function renderHeader(&$header)
77 } // end func renderHeader
80 * Called when visiting an element
82 * @param object An HTML_QuickForm_element object being visited
83 * @param bool Whether an element is required
84 * @param string An error message associated with an element
89 function renderElement(&$element, $required, $error)
92 } // end func renderElement
95 * Called when visiting a hidden element
97 * @param object An HTML_QuickForm_hidden object being visited
102 function renderHidden(&$element)
105 } // end func renderHidden
108 * Called when visiting a raw HTML/text pseudo-element
110 * Seems that this should not be used when using a template-based renderer
112 * @param object An HTML_QuickForm_html element being visited
117 function renderHtml(&$data)
120 } // end func renderHtml
123 * Called when visiting a group, before processing any group elements
125 * @param object An HTML_QuickForm_group object being visited
126 * @param bool Whether a group is required
127 * @param string An error message associated with a group
132 function startGroup(&$group, $required, $error)
135 } // end func startGroup
138 * Called when visiting a group, after processing all group elements
140 * @param object An HTML_QuickForm_group object being visited
145 function finishGroup(&$group)
148 } // end func finishGroup
149 } // end class HTML_QuickForm_Renderer