@@ -56,128 +56,128 @@ discard block |
||
56 | 56 | $this->customElementTemplate = $customElementTemplate; |
57 | 57 | } |
58 | 58 | |
59 | - /** |
|
60 | - * The HTML of the form |
|
61 | - * @var string |
|
62 | - * @access private |
|
63 | - */ |
|
59 | + /** |
|
60 | + * The HTML of the form |
|
61 | + * @var string |
|
62 | + * @access private |
|
63 | + */ |
|
64 | 64 | var $_html; |
65 | 65 | |
66 | - /** |
|
67 | - * Header Template string |
|
68 | - * @var string |
|
69 | - * @access private |
|
70 | - */ |
|
66 | + /** |
|
67 | + * Header Template string |
|
68 | + * @var string |
|
69 | + * @access private |
|
70 | + */ |
|
71 | 71 | var $_headerTemplate = |
72 | 72 | "\n\t<tr>\n\t\t<td style=\"white-space: nowrap; background-color: #CCCCCC;\" align=\"left\" valign=\"top\" colspan=\"2\"><b>{header}</b></td>\n\t</tr>"; |
73 | 73 | |
74 | - /** |
|
75 | - * Element template string |
|
76 | - * @var string |
|
77 | - * @access private |
|
78 | - */ |
|
74 | + /** |
|
75 | + * Element template string |
|
76 | + * @var string |
|
77 | + * @access private |
|
78 | + */ |
|
79 | 79 | var $_elementTemplate = |
80 | 80 | "\n\t<tr>\n\t\t<td align=\"right\" valign=\"top\"><!-- BEGIN required --><span style=\"color: #ff0000\">*</span><!-- END required --><b>{label}</b></td>\n\t\t<td valign=\"top\" align=\"left\"><!-- BEGIN error --><span style=\"color: #ff0000\">{error}</span><br /><!-- END error -->\t{element}</td>\n\t</tr>"; |
81 | 81 | |
82 | - /** |
|
83 | - * Form template string |
|
84 | - * @var string |
|
85 | - * @access private |
|
86 | - */ |
|
82 | + /** |
|
83 | + * Form template string |
|
84 | + * @var string |
|
85 | + * @access private |
|
86 | + */ |
|
87 | 87 | var $_formTemplate = |
88 | 88 | "\n<form{attributes}>\n<div>\n{hidden}<table border=\"0\">\n{content}\n</table>\n</div>\n</form>"; |
89 | 89 | |
90 | - /** |
|
91 | - * Required Note template string |
|
92 | - * @var string |
|
93 | - * @access private |
|
94 | - */ |
|
90 | + /** |
|
91 | + * Required Note template string |
|
92 | + * @var string |
|
93 | + * @access private |
|
94 | + */ |
|
95 | 95 | var $_requiredNoteTemplate = |
96 | 96 | "\n\t<tr>\n\t\t<td></td>\n\t<td align=\"left\" valign=\"top\">{requiredNote}</td>\n\t</tr>"; |
97 | 97 | |
98 | - /** |
|
99 | - * Array containing the templates for customised elements |
|
100 | - * @var array |
|
101 | - * @access private |
|
102 | - */ |
|
98 | + /** |
|
99 | + * Array containing the templates for customised elements |
|
100 | + * @var array |
|
101 | + * @access private |
|
102 | + */ |
|
103 | 103 | var $_templates = array(); |
104 | 104 | |
105 | - /** |
|
106 | - * Array containing the templates for group wraps. |
|
107 | - * |
|
108 | - * These templates are wrapped around group elements and groups' own |
|
109 | - * templates wrap around them. This is set by setGroupTemplate(). |
|
110 | - * |
|
111 | - * @var array |
|
112 | - * @access private |
|
113 | - */ |
|
105 | + /** |
|
106 | + * Array containing the templates for group wraps. |
|
107 | + * |
|
108 | + * These templates are wrapped around group elements and groups' own |
|
109 | + * templates wrap around them. This is set by setGroupTemplate(). |
|
110 | + * |
|
111 | + * @var array |
|
112 | + * @access private |
|
113 | + */ |
|
114 | 114 | var $_groupWraps = array(); |
115 | 115 | |
116 | - /** |
|
117 | - * Array containing the templates for elements within groups |
|
118 | - * @var array |
|
119 | - * @access private |
|
120 | - */ |
|
116 | + /** |
|
117 | + * Array containing the templates for elements within groups |
|
118 | + * @var array |
|
119 | + * @access private |
|
120 | + */ |
|
121 | 121 | var $_groupTemplates = array(); |
122 | 122 | |
123 | - /** |
|
124 | - * True if we are inside a group |
|
125 | - * @var bool |
|
126 | - * @access private |
|
127 | - */ |
|
123 | + /** |
|
124 | + * True if we are inside a group |
|
125 | + * @var bool |
|
126 | + * @access private |
|
127 | + */ |
|
128 | 128 | var $_inGroup = false; |
129 | 129 | |
130 | - /** |
|
131 | - * Array with HTML generated for group elements |
|
132 | - * @var array |
|
133 | - * @access private |
|
134 | - */ |
|
130 | + /** |
|
131 | + * Array with HTML generated for group elements |
|
132 | + * @var array |
|
133 | + * @access private |
|
134 | + */ |
|
135 | 135 | var $_groupElements = array(); |
136 | 136 | |
137 | - /** |
|
138 | - * Template for an element inside a group |
|
139 | - * @var string |
|
140 | - * @access private |
|
141 | - */ |
|
137 | + /** |
|
138 | + * Template for an element inside a group |
|
139 | + * @var string |
|
140 | + * @access private |
|
141 | + */ |
|
142 | 142 | var $_groupElementTemplate = ''; |
143 | 143 | |
144 | - /** |
|
145 | - * HTML that wraps around the group elements |
|
146 | - * @var string |
|
147 | - * @access private |
|
148 | - */ |
|
144 | + /** |
|
145 | + * HTML that wraps around the group elements |
|
146 | + * @var string |
|
147 | + * @access private |
|
148 | + */ |
|
149 | 149 | var $_groupWrap = ''; |
150 | 150 | |
151 | - /** |
|
152 | - * HTML for the current group |
|
153 | - * @var string |
|
154 | - * @access private |
|
155 | - */ |
|
151 | + /** |
|
152 | + * HTML for the current group |
|
153 | + * @var string |
|
154 | + * @access private |
|
155 | + */ |
|
156 | 156 | var $_groupTemplate = ''; |
157 | 157 | |
158 | - /** |
|
159 | - * Collected HTML of the hidden fields |
|
160 | - * @var string |
|
161 | - * @access private |
|
162 | - */ |
|
158 | + /** |
|
159 | + * Collected HTML of the hidden fields |
|
160 | + * @var string |
|
161 | + * @access private |
|
162 | + */ |
|
163 | 163 | var $_hiddenHtml = ''; |
164 | 164 | |
165 | - /** |
|
166 | - * Constructor |
|
167 | - * |
|
168 | - * @access public |
|
169 | - */ |
|
165 | + /** |
|
166 | + * Constructor |
|
167 | + * |
|
168 | + * @access public |
|
169 | + */ |
|
170 | 170 | public function HTML_QuickForm_Renderer_Default() |
171 | 171 | { |
172 | 172 | parent::__construct(); |
173 | 173 | } // end constructor |
174 | 174 | |
175 | - /** |
|
176 | - * returns the HTML generated for the form |
|
177 | - * |
|
178 | - * @access public |
|
179 | - * @return string |
|
180 | - */ |
|
175 | + /** |
|
176 | + * returns the HTML generated for the form |
|
177 | + * |
|
178 | + * @access public |
|
179 | + * @return string |
|
180 | + */ |
|
181 | 181 | public function toHtml() |
182 | 182 | { |
183 | 183 | // _hiddenHtml is cleared in finishForm(), so this only matters when |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | return $this->_hiddenHtml . $this->_html; |
186 | 186 | } // end func toHtml |
187 | 187 | |
188 | - /** |
|
189 | - * Called when visiting a form, before processing any form elements |
|
190 | - * |
|
191 | - * @param HTML_QuickForm form object being visited |
|
192 | - * @access public |
|
193 | - * @return void |
|
194 | - */ |
|
188 | + /** |
|
189 | + * Called when visiting a form, before processing any form elements |
|
190 | + * |
|
191 | + * @param HTML_QuickForm form object being visited |
|
192 | + * @access public |
|
193 | + * @return void |
|
194 | + */ |
|
195 | 195 | function startForm(&$form) |
196 | 196 | { |
197 | 197 | $this->setForm($form); |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | |
219 | 219 | |
220 | 220 | |
221 | - /** |
|
222 | - * Called when visiting a form, after processing all form elements |
|
223 | - * Adds required note, form attributes, validation javascript and form content. |
|
224 | - * |
|
225 | - * @param HTML_QuickForm form object being visited |
|
226 | - * @access public |
|
227 | - * @return void |
|
228 | - */ |
|
221 | + /** |
|
222 | + * Called when visiting a form, after processing all form elements |
|
223 | + * Adds required note, form attributes, validation javascript and form content. |
|
224 | + * |
|
225 | + * @param HTML_QuickForm form object being visited |
|
226 | + * @access public |
|
227 | + * @return void |
|
228 | + */ |
|
229 | 229 | public function finishForm(&$form) |
230 | 230 | { |
231 | 231 | // add a required note, if one is needed |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | } |
249 | 249 | } // end func finishForm |
250 | 250 | |
251 | - /** |
|
252 | - * Called when visiting a header element |
|
253 | - * |
|
254 | - * @param HTML_QuickForm_header header element being visited |
|
255 | - * @access public |
|
256 | - * @return void |
|
257 | - */ |
|
251 | + /** |
|
252 | + * Called when visiting a header element |
|
253 | + * |
|
254 | + * @param HTML_QuickForm_header header element being visited |
|
255 | + * @access public |
|
256 | + * @return void |
|
257 | + */ |
|
258 | 258 | function renderHeader(&$header) |
259 | 259 | { |
260 | 260 | $name = $header->getName(); |
@@ -265,17 +265,17 @@ discard block |
||
265 | 265 | } |
266 | 266 | } // end func renderHeader |
267 | 267 | |
268 | - /** |
|
269 | - * Helper method for renderElement |
|
270 | - * |
|
271 | - * @param HTML_QuickForm_element $element |
|
272 | - * @param bool Whether an element is required |
|
273 | - * @param string $required Error message associated with the element |
|
274 | - * @param string $error Label for ID |
|
275 | - * @access private |
|
276 | - * @see renderElement() |
|
277 | - * @return string Html for element |
|
278 | - */ |
|
268 | + /** |
|
269 | + * Helper method for renderElement |
|
270 | + * |
|
271 | + * @param HTML_QuickForm_element $element |
|
272 | + * @param bool Whether an element is required |
|
273 | + * @param string $required Error message associated with the element |
|
274 | + * @param string $error Label for ID |
|
275 | + * @access private |
|
276 | + * @see renderElement() |
|
277 | + * @return string Html for element |
|
278 | + */ |
|
279 | 279 | private function _prepareTemplate(HTML_QuickForm_element $element, $required, $error) |
280 | 280 | { |
281 | 281 | $name = $element->getName(); |
@@ -343,16 +343,16 @@ discard block |
||
343 | 343 | return $html; |
344 | 344 | } // end func _prepareTemplate |
345 | 345 | |
346 | - /** |
|
347 | - * Renders an element Html |
|
348 | - * Called when visiting an element |
|
349 | - * |
|
350 | - * @param HTML_QuickForm_element form element being visited |
|
351 | - * @param bool Whether an element is required |
|
352 | - * @param string An error message associated with an element |
|
353 | - * @access public |
|
354 | - * @return void |
|
355 | - */ |
|
346 | + /** |
|
347 | + * Renders an element Html |
|
348 | + * Called when visiting an element |
|
349 | + * |
|
350 | + * @param HTML_QuickForm_element form element being visited |
|
351 | + * @param bool Whether an element is required |
|
352 | + * @param string An error message associated with an element |
|
353 | + * @access public |
|
354 | + * @return void |
|
355 | + */ |
|
356 | 356 | public function renderElement(&$element, $required, $error) |
357 | 357 | { |
358 | 358 | if (!$this->_inGroup) { |
@@ -379,40 +379,40 @@ discard block |
||
379 | 379 | } |
380 | 380 | } // end func renderElement |
381 | 381 | |
382 | - /** |
|
383 | - * Renders an hidden element |
|
384 | - * Called when visiting a hidden element |
|
385 | - * |
|
386 | - * @param HTML_QuickForm_element form element being visited |
|
387 | - * @access public |
|
388 | - * @return void |
|
389 | - */ |
|
382 | + /** |
|
383 | + * Renders an hidden element |
|
384 | + * Called when visiting a hidden element |
|
385 | + * |
|
386 | + * @param HTML_QuickForm_element form element being visited |
|
387 | + * @access public |
|
388 | + * @return void |
|
389 | + */ |
|
390 | 390 | function renderHidden(&$element) |
391 | 391 | { |
392 | 392 | $this->_hiddenHtml .= $element->toHtml() . "\n"; |
393 | 393 | } // end func renderHidden |
394 | 394 | |
395 | - /** |
|
396 | - * Called when visiting a raw HTML/text pseudo-element |
|
397 | - * |
|
398 | - * @param HTML_QuickForm_html element being visited |
|
399 | - * @access public |
|
400 | - * @return void |
|
401 | - */ |
|
395 | + /** |
|
396 | + * Called when visiting a raw HTML/text pseudo-element |
|
397 | + * |
|
398 | + * @param HTML_QuickForm_html element being visited |
|
399 | + * @access public |
|
400 | + * @return void |
|
401 | + */ |
|
402 | 402 | function renderHtml(&$data) |
403 | 403 | { |
404 | 404 | $this->_html .= $data->toHtml(); |
405 | 405 | } // end func renderHtml |
406 | 406 | |
407 | - /** |
|
408 | - * Called when visiting a group, before processing any group elements |
|
409 | - * |
|
410 | - * @param HTML_QuickForm_group group being visited |
|
411 | - * @param bool Whether a group is required |
|
412 | - * @param string An error message associated with a group |
|
413 | - * @access public |
|
414 | - * @return void |
|
415 | - */ |
|
407 | + /** |
|
408 | + * Called when visiting a group, before processing any group elements |
|
409 | + * |
|
410 | + * @param HTML_QuickForm_group group being visited |
|
411 | + * @param bool Whether a group is required |
|
412 | + * @param string An error message associated with a group |
|
413 | + * @access public |
|
414 | + * @return void |
|
415 | + */ |
|
416 | 416 | function startGroup(&$group, $required, $error) |
417 | 417 | { |
418 | 418 | $name = $group->getName(); |
@@ -423,13 +423,13 @@ discard block |
||
423 | 423 | $this->_inGroup = true; |
424 | 424 | } // end func startGroup |
425 | 425 | |
426 | - /** |
|
427 | - * Called when visiting a group, after processing all group elements |
|
428 | - * |
|
429 | - * @param HTML_QuickForm_group group being visited |
|
430 | - * @access public |
|
431 | - * @return void |
|
432 | - */ |
|
426 | + /** |
|
427 | + * Called when visiting a group, after processing all group elements |
|
428 | + * |
|
429 | + * @param HTML_QuickForm_group group being visited |
|
430 | + * @access public |
|
431 | + * @return void |
|
432 | + */ |
|
433 | 433 | function finishGroup(&$group) |
434 | 434 | { |
435 | 435 | $separator = $group->_separator; |
@@ -109,60 +109,60 @@ discard block |
||
109 | 109 | */ |
110 | 110 | class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer |
111 | 111 | { |
112 | - /**#@+ |
|
112 | + /**#@+ |
|
113 | 113 | * @access private |
114 | 114 | */ |
115 | - /** |
|
116 | - * An array being generated |
|
117 | - * @var array |
|
118 | - */ |
|
115 | + /** |
|
116 | + * An array being generated |
|
117 | + * @var array |
|
118 | + */ |
|
119 | 119 | var $_ary; |
120 | 120 | |
121 | - /** |
|
122 | - * Number of sections in the form (i.e. number of headers in it) |
|
123 | - * @var integer |
|
124 | - */ |
|
121 | + /** |
|
122 | + * Number of sections in the form (i.e. number of headers in it) |
|
123 | + * @var integer |
|
124 | + */ |
|
125 | 125 | var $_sectionCount; |
126 | 126 | |
127 | - /** |
|
128 | - * Current section number |
|
129 | - * @var integer |
|
130 | - */ |
|
127 | + /** |
|
128 | + * Current section number |
|
129 | + * @var integer |
|
130 | + */ |
|
131 | 131 | var $_currentSection; |
132 | 132 | |
133 | - /** |
|
134 | - * Array representing current group |
|
135 | - * @var array |
|
136 | - */ |
|
133 | + /** |
|
134 | + * Array representing current group |
|
135 | + * @var array |
|
136 | + */ |
|
137 | 137 | var $_currentGroup = null; |
138 | 138 | |
139 | - /** |
|
140 | - * Additional style information for different elements |
|
141 | - * @var array |
|
142 | - */ |
|
139 | + /** |
|
140 | + * Additional style information for different elements |
|
141 | + * @var array |
|
142 | + */ |
|
143 | 143 | var $_elementStyles = array(); |
144 | 144 | |
145 | - /** |
|
146 | - * true: collect all hidden elements into string; false: process them as usual form elements |
|
147 | - * @var bool |
|
148 | - */ |
|
145 | + /** |
|
146 | + * true: collect all hidden elements into string; false: process them as usual form elements |
|
147 | + * @var bool |
|
148 | + */ |
|
149 | 149 | var $_collectHidden = false; |
150 | 150 | |
151 | - /** |
|
152 | - * true: render an array of labels to many labels, $key 0 named 'label', the rest "label_$key" |
|
153 | - * false: leave labels as defined |
|
154 | - * @var bool |
|
155 | - */ |
|
151 | + /** |
|
152 | + * true: render an array of labels to many labels, $key 0 named 'label', the rest "label_$key" |
|
153 | + * false: leave labels as defined |
|
154 | + * @var bool |
|
155 | + */ |
|
156 | 156 | var $_staticLabels = false; |
157 | - /**#@-*/ |
|
157 | + /**#@-*/ |
|
158 | 158 | |
159 | - /** |
|
160 | - * Constructor |
|
161 | - * |
|
162 | - * @param bool true: collect all hidden elements into string; false: process them as usual form elements |
|
163 | - * @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key" |
|
164 | - * @access public |
|
165 | - */ |
|
159 | + /** |
|
160 | + * Constructor |
|
161 | + * |
|
162 | + * @param bool true: collect all hidden elements into string; false: process them as usual form elements |
|
163 | + * @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key" |
|
164 | + * @access public |
|
165 | + */ |
|
166 | 166 | function HTML_QuickForm_Renderer_Array($collectHidden = false, $staticLabels = false) |
167 | 167 | { |
168 | 168 | $this->HTML_QuickForm_Renderer(); |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | } // end constructor |
172 | 172 | |
173 | 173 | |
174 | - /** |
|
175 | - * Returns the resultant array |
|
176 | - * |
|
177 | - * @access public |
|
178 | - * @return array |
|
179 | - */ |
|
174 | + /** |
|
175 | + * Returns the resultant array |
|
176 | + * |
|
177 | + * @access public |
|
178 | + * @return array |
|
179 | + */ |
|
180 | 180 | function toArray() |
181 | 181 | { |
182 | 182 | return $this->_ary; |
@@ -247,15 +247,15 @@ discard block |
||
247 | 247 | } // end func finishGroup |
248 | 248 | |
249 | 249 | |
250 | - /** |
|
251 | - * Creates an array representing an element |
|
252 | - * |
|
253 | - * @access private |
|
254 | - * @param HTML_QuickForm_element element being processed |
|
255 | - * @param bool Whether an element is required |
|
256 | - * @param string Error associated with the element |
|
257 | - * @return array |
|
258 | - */ |
|
250 | + /** |
|
251 | + * Creates an array representing an element |
|
252 | + * |
|
253 | + * @access private |
|
254 | + * @param HTML_QuickForm_element element being processed |
|
255 | + * @param bool Whether an element is required |
|
256 | + * @param string Error associated with the element |
|
257 | + * @return array |
|
258 | + */ |
|
259 | 259 | function _elementToArray(&$element, $required, $error) |
260 | 260 | { |
261 | 261 | $ret = array( |
@@ -295,13 +295,13 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | |
298 | - /** |
|
299 | - * Stores an array representation of an element in the form array |
|
300 | - * |
|
301 | - * @access private |
|
302 | - * @param array Array representation of an element |
|
303 | - * @return void |
|
304 | - */ |
|
298 | + /** |
|
299 | + * Stores an array representation of an element in the form array |
|
300 | + * |
|
301 | + * @access private |
|
302 | + * @param array Array representation of an element |
|
303 | + * @return void |
|
304 | + */ |
|
305 | 305 | function _storeArray($elAry) |
306 | 306 | { |
307 | 307 | // where should we put this element... |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | |
318 | - /** |
|
319 | - * Sets a style to use for element rendering |
|
320 | - * |
|
321 | - * @param mixed element name or array ('element name' => 'style name') |
|
322 | - * @param string style name if $elementName is not an array |
|
323 | - * @access public |
|
324 | - * @return void |
|
325 | - */ |
|
318 | + /** |
|
319 | + * Sets a style to use for element rendering |
|
320 | + * |
|
321 | + * @param mixed element name or array ('element name' => 'style name') |
|
322 | + * @param string style name if $elementName is not an array |
|
323 | + * @access public |
|
324 | + * @return void |
|
325 | + */ |
|
326 | 326 | function setElementStyle($elementName, $styleName = null) |
327 | 327 | { |
328 | 328 | if (is_array($elementName)) { |
@@ -40,58 +40,58 @@ discard block |
||
40 | 40 | */ |
41 | 41 | class HTML_QuickForm_Renderer_ITDynamic extends HTML_QuickForm_Renderer |
42 | 42 | { |
43 | - /**#@+ |
|
43 | + /**#@+ |
|
44 | 44 | * @access private |
45 | 45 | */ |
46 | - /** |
|
47 | - * A template class (HTML_Template_ITX or HTML_Template_Sigma) instance |
|
48 | - * @var HTML_Template_ITX|HTML_Template_Sigma |
|
49 | - */ |
|
46 | + /** |
|
47 | + * A template class (HTML_Template_ITX or HTML_Template_Sigma) instance |
|
48 | + * @var HTML_Template_ITX|HTML_Template_Sigma |
|
49 | + */ |
|
50 | 50 | var $_tpl = null; |
51 | 51 | |
52 | - /** |
|
53 | - * The errors that were not shown near concrete fields go here |
|
54 | - * @var array |
|
55 | - */ |
|
52 | + /** |
|
53 | + * The errors that were not shown near concrete fields go here |
|
54 | + * @var array |
|
55 | + */ |
|
56 | 56 | var $_errors = array(); |
57 | 57 | |
58 | - /** |
|
59 | - * Show the block with required note? |
|
60 | - * @var bool |
|
61 | - */ |
|
58 | + /** |
|
59 | + * Show the block with required note? |
|
60 | + * @var bool |
|
61 | + */ |
|
62 | 62 | var $_showRequired = false; |
63 | 63 | |
64 | - /** |
|
65 | - * A separator for group elements |
|
66 | - * @var mixed |
|
67 | - */ |
|
64 | + /** |
|
65 | + * A separator for group elements |
|
66 | + * @var mixed |
|
67 | + */ |
|
68 | 68 | var $_groupSeparator = null; |
69 | 69 | |
70 | - /** |
|
71 | - * The current element index inside a group |
|
72 | - * @var integer |
|
73 | - */ |
|
70 | + /** |
|
71 | + * The current element index inside a group |
|
72 | + * @var integer |
|
73 | + */ |
|
74 | 74 | var $_groupElementIdx = 0; |
75 | 75 | |
76 | - /** |
|
77 | - * Blocks to use for different elements |
|
78 | - * @var array |
|
79 | - */ |
|
76 | + /** |
|
77 | + * Blocks to use for different elements |
|
78 | + * @var array |
|
79 | + */ |
|
80 | 80 | var $_elementBlocks = array(); |
81 | 81 | |
82 | - /** |
|
83 | - * Block to use for headers |
|
84 | - * @var string |
|
85 | - */ |
|
82 | + /** |
|
83 | + * Block to use for headers |
|
84 | + * @var string |
|
85 | + */ |
|
86 | 86 | var $_headerBlock = null; |
87 | - /**#@-*/ |
|
87 | + /**#@-*/ |
|
88 | 88 | |
89 | 89 | |
90 | - /** |
|
91 | - * Constructor |
|
92 | - * |
|
93 | - * @param HTML_Template_ITX|HTML_Template_Sigma Template object to use |
|
94 | - */ |
|
90 | + /** |
|
91 | + * Constructor |
|
92 | + * |
|
93 | + * @param HTML_Template_ITX|HTML_Template_Sigma Template object to use |
|
94 | + */ |
|
95 | 95 | function HTML_QuickForm_Renderer_ITDynamic(&$tpl) |
96 | 96 | { |
97 | 97 | $this->HTML_QuickForm_Renderer(); |
@@ -227,17 +227,17 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | |
230 | - /** |
|
231 | - * Returns the name of a block to use for element rendering |
|
232 | - * |
|
233 | - * If a name was not explicitly set via setElementBlock(), it tries |
|
234 | - * the names '{prefix}_{element type}' and '{prefix}_{element}', where |
|
235 | - * prefix is either 'qf' or the name of the current group's block |
|
236 | - * |
|
237 | - * @param HTML_QuickForm_element form element being rendered |
|
238 | - * @access private |
|
239 | - * @return string block name |
|
240 | - */ |
|
230 | + /** |
|
231 | + * Returns the name of a block to use for element rendering |
|
232 | + * |
|
233 | + * If a name was not explicitly set via setElementBlock(), it tries |
|
234 | + * the names '{prefix}_{element type}' and '{prefix}_{element}', where |
|
235 | + * prefix is either 'qf' or the name of the current group's block |
|
236 | + * |
|
237 | + * @param HTML_QuickForm_element form element being rendered |
|
238 | + * @access private |
|
239 | + * @return string block name |
|
240 | + */ |
|
241 | 241 | function _matchBlock(&$element) |
242 | 242 | { |
243 | 243 | $name = $element->getName(); |
@@ -262,14 +262,14 @@ discard block |
||
262 | 262 | } |
263 | 263 | |
264 | 264 | |
265 | - /** |
|
266 | - * Sets the block to use for element rendering |
|
267 | - * |
|
268 | - * @param mixed element name or array ('element name' => 'block name') |
|
269 | - * @param string block name if $elementName is not an array |
|
270 | - * @access public |
|
271 | - * @return void |
|
272 | - */ |
|
265 | + /** |
|
266 | + * Sets the block to use for element rendering |
|
267 | + * |
|
268 | + * @param mixed element name or array ('element name' => 'block name') |
|
269 | + * @param string block name if $elementName is not an array |
|
270 | + * @access public |
|
271 | + * @return void |
|
272 | + */ |
|
273 | 273 | function setElementBlock($elementName, $blockName = null) |
274 | 274 | { |
275 | 275 | if (is_array($elementName)) { |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | |
283 | - /** |
|
284 | - * Sets the name of a block to use for header rendering |
|
285 | - * |
|
286 | - * @param string block name |
|
287 | - * @access public |
|
288 | - * @return void |
|
289 | - */ |
|
283 | + /** |
|
284 | + * Sets the name of a block to use for header rendering |
|
285 | + * |
|
286 | + * @param string block name |
|
287 | + * @access public |
|
288 | + * @return void |
|
289 | + */ |
|
290 | 290 | function setHeaderBlock($blockName) |
291 | 291 | { |
292 | 292 | $this->_headerBlock = $blockName; |
@@ -87,63 +87,63 @@ discard block |
||
87 | 87 | */ |
88 | 88 | class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array |
89 | 89 | { |
90 | - /**#@+ |
|
90 | + /**#@+ |
|
91 | 91 | * @access private |
92 | 92 | */ |
93 | - /** |
|
94 | - * The Smarty template engine instance |
|
95 | - * @var object |
|
96 | - */ |
|
93 | + /** |
|
94 | + * The Smarty template engine instance |
|
95 | + * @var object |
|
96 | + */ |
|
97 | 97 | var $_tpl = null; |
98 | 98 | |
99 | - /** |
|
100 | - * Current element index |
|
101 | - * @var integer |
|
102 | - */ |
|
99 | + /** |
|
100 | + * Current element index |
|
101 | + * @var integer |
|
102 | + */ |
|
103 | 103 | var $_elementIdx = 0; |
104 | 104 | |
105 | 105 | /** |
106 | - * The current element index inside a group |
|
107 | - * @var integer |
|
108 | - */ |
|
106 | + * The current element index inside a group |
|
107 | + * @var integer |
|
108 | + */ |
|
109 | 109 | var $_groupElementIdx = 0; |
110 | 110 | |
111 | - /** |
|
112 | - * How to handle the required tag for required fields |
|
113 | - * @var string |
|
114 | - * @see setRequiredTemplate() |
|
115 | - */ |
|
111 | + /** |
|
112 | + * How to handle the required tag for required fields |
|
113 | + * @var string |
|
114 | + * @see setRequiredTemplate() |
|
115 | + */ |
|
116 | 116 | var $_required = ''; |
117 | 117 | |
118 | - /** |
|
119 | - * How to handle error messages in form validation |
|
120 | - * @var string |
|
121 | - * @see setErrorTemplate() |
|
122 | - */ |
|
118 | + /** |
|
119 | + * How to handle error messages in form validation |
|
120 | + * @var string |
|
121 | + * @see setErrorTemplate() |
|
122 | + */ |
|
123 | 123 | var $_error = ''; |
124 | - /**#@-*/ |
|
124 | + /**#@-*/ |
|
125 | 125 | |
126 | - /** |
|
127 | - * Constructor |
|
128 | - * |
|
129 | - * @param Smarty reference to the Smarty template engine instance |
|
130 | - * @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key" |
|
131 | - * @param bool true: collect all hidden elements into string; false: process them as usual form elements |
|
132 | - * @access public |
|
133 | - */ |
|
126 | + /** |
|
127 | + * Constructor |
|
128 | + * |
|
129 | + * @param Smarty reference to the Smarty template engine instance |
|
130 | + * @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key" |
|
131 | + * @param bool true: collect all hidden elements into string; false: process them as usual form elements |
|
132 | + * @access public |
|
133 | + */ |
|
134 | 134 | function HTML_QuickForm_Renderer_ArraySmarty(&$tpl, $staticLabels = false, $collectHidden = true) |
135 | 135 | { |
136 | 136 | $this->HTML_QuickForm_Renderer_Array($collectHidden, $staticLabels); |
137 | 137 | $this->_tpl =& $tpl; |
138 | 138 | } // end constructor |
139 | 139 | |
140 | - /** |
|
141 | - * Called when visiting a header element |
|
142 | - * |
|
143 | - * @param HTML_QuickForm_header header element being visited |
|
144 | - * @access public |
|
145 | - * @return void |
|
146 | - */ |
|
140 | + /** |
|
141 | + * Called when visiting a header element |
|
142 | + * |
|
143 | + * @param HTML_QuickForm_header header element being visited |
|
144 | + * @access public |
|
145 | + * @return void |
|
146 | + */ |
|
147 | 147 | function renderHeader(&$header) |
148 | 148 | { |
149 | 149 | if ($name = $header->getName()) { |
@@ -154,31 +154,31 @@ discard block |
||
154 | 154 | $this->_currentSection = $this->_sectionCount++; |
155 | 155 | } // end func renderHeader |
156 | 156 | |
157 | - /** |
|
158 | - * Called when visiting a group, before processing any group elements |
|
159 | - * |
|
160 | - * @param HTML_QuickForm_group group being visited |
|
161 | - * @param bool Whether a group is required |
|
162 | - * @param string An error message associated with a group |
|
163 | - * @access public |
|
164 | - * @return void |
|
165 | - */ |
|
157 | + /** |
|
158 | + * Called when visiting a group, before processing any group elements |
|
159 | + * |
|
160 | + * @param HTML_QuickForm_group group being visited |
|
161 | + * @param bool Whether a group is required |
|
162 | + * @param string An error message associated with a group |
|
163 | + * @access public |
|
164 | + * @return void |
|
165 | + */ |
|
166 | 166 | function startGroup(&$group, $required, $error) |
167 | 167 | { |
168 | 168 | parent::startGroup($group, $required, $error); |
169 | 169 | $this->_groupElementIdx = 1; |
170 | 170 | } // end func startGroup |
171 | 171 | |
172 | - /** |
|
173 | - * Creates an array representing an element containing |
|
174 | - * the key for storing this |
|
175 | - * |
|
176 | - * @access private |
|
177 | - * @param HTML_QuickForm_element form element being visited |
|
178 | - * @param bool Whether an element is required |
|
179 | - * @param string Error associated with the element |
|
180 | - * @return array |
|
181 | - */ |
|
172 | + /** |
|
173 | + * Creates an array representing an element containing |
|
174 | + * the key for storing this |
|
175 | + * |
|
176 | + * @access private |
|
177 | + * @param HTML_QuickForm_element form element being visited |
|
178 | + * @param bool Whether an element is required |
|
179 | + * @param string Error associated with the element |
|
180 | + * @return array |
|
181 | + */ |
|
182 | 182 | function _elementToArray(&$element, $required, $error) |
183 | 183 | { |
184 | 184 | $ret = parent::_elementToArray($element, $required, $error); |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | return $ret; |
243 | 243 | } // end func _elementToArray |
244 | 244 | |
245 | - /** |
|
246 | - * Stores an array representation of an element in the form array |
|
247 | - * |
|
248 | - * @access private |
|
249 | - * @param array Array representation of an element |
|
250 | - * @return void |
|
251 | - */ |
|
245 | + /** |
|
246 | + * Stores an array representation of an element in the form array |
|
247 | + * |
|
248 | + * @access private |
|
249 | + * @param array Array representation of an element |
|
250 | + * @return void |
|
251 | + */ |
|
252 | 252 | function _storeArray($elAry) |
253 | 253 | { |
254 | 254 | if ($elAry) { |
@@ -265,20 +265,20 @@ discard block |
||
265 | 265 | return; |
266 | 266 | } |
267 | 267 | |
268 | - /** |
|
269 | - * Called when an element is required |
|
270 | - * |
|
271 | - * This method will add the required tag to the element label and/or the element html |
|
272 | - * such as defined with the method setRequiredTemplate. |
|
273 | - * |
|
274 | - * @param string The element label |
|
275 | - * @param string The element html rendering |
|
276 | - * @param boolean The element required |
|
277 | - * @param string The element error |
|
278 | - * @see setRequiredTemplate() |
|
279 | - * @access private |
|
280 | - * @return void |
|
281 | - */ |
|
268 | + /** |
|
269 | + * Called when an element is required |
|
270 | + * |
|
271 | + * This method will add the required tag to the element label and/or the element html |
|
272 | + * such as defined with the method setRequiredTemplate. |
|
273 | + * |
|
274 | + * @param string The element label |
|
275 | + * @param string The element html rendering |
|
276 | + * @param boolean The element required |
|
277 | + * @param string The element error |
|
278 | + * @see setRequiredTemplate() |
|
279 | + * @access private |
|
280 | + * @return void |
|
281 | + */ |
|
282 | 282 | function _renderRequired(&$label, &$html, &$required, &$error) |
283 | 283 | { |
284 | 284 | $this->_tpl->assign(array( |
@@ -296,20 +296,20 @@ discard block |
||
296 | 296 | $this->_tpl->clear_assign(array('label', 'html', 'required')); |
297 | 297 | } // end func _renderRequired |
298 | 298 | |
299 | - /** |
|
300 | - * Called when an element has a validation error |
|
301 | - * |
|
302 | - * This method will add the error message to the element label or the element html |
|
303 | - * such as defined with the method setErrorTemplate. If the error placeholder is not found |
|
304 | - * in the template, the error will be displayed in the form error block. |
|
305 | - * |
|
306 | - * @param string The element label |
|
307 | - * @param string The element html rendering |
|
308 | - * @param string The element error |
|
309 | - * @see setErrorTemplate() |
|
310 | - * @access private |
|
311 | - * @return void |
|
312 | - */ |
|
299 | + /** |
|
300 | + * Called when an element has a validation error |
|
301 | + * |
|
302 | + * This method will add the error message to the element label or the element html |
|
303 | + * such as defined with the method setErrorTemplate. If the error placeholder is not found |
|
304 | + * in the template, the error will be displayed in the form error block. |
|
305 | + * |
|
306 | + * @param string The element label |
|
307 | + * @param string The element html rendering |
|
308 | + * @param string The element error |
|
309 | + * @see setErrorTemplate() |
|
310 | + * @access private |
|
311 | + * @return void |
|
312 | + */ |
|
313 | 313 | function _renderError(&$label, &$html, &$error) |
314 | 314 | { |
315 | 315 | $this->_tpl->assign(array('label' => '', 'html' => '', 'error' => $error)); |
@@ -324,16 +324,16 @@ discard block |
||
324 | 324 | $this->_tpl->clear_assign(array('label', 'html', 'error')); |
325 | 325 | } // end func _renderError |
326 | 326 | |
327 | - /** |
|
328 | - * Process an template sourced in a string with Smarty |
|
329 | - * |
|
330 | - * Smarty has no core function to render a template given as a string. |
|
331 | - * So we use the smarty eval plugin function to do this. |
|
332 | - * |
|
333 | - * @param string The template source |
|
334 | - * @access private |
|
335 | - * @return void |
|
336 | - */ |
|
327 | + /** |
|
328 | + * Process an template sourced in a string with Smarty |
|
329 | + * |
|
330 | + * Smarty has no core function to render a template given as a string. |
|
331 | + * So we use the smarty eval plugin function to do this. |
|
332 | + * |
|
333 | + * @param string The template source |
|
334 | + * @access private |
|
335 | + * @return void |
|
336 | + */ |
|
337 | 337 | function _tplFetch($tplSource) |
338 | 338 | { |
339 | 339 | if (!function_exists('smarty_function_eval')) { |
@@ -342,54 +342,54 @@ discard block |
||
342 | 342 | return smarty_function_eval(array('var' => $tplSource), $this->_tpl); |
343 | 343 | }// end func _tplFetch |
344 | 344 | |
345 | - /** |
|
346 | - * Sets the way required elements are rendered |
|
347 | - * |
|
348 | - * You can use {$label} or {$html} placeholders to let the renderer know where |
|
349 | - * where the element label or the element html are positionned according to the |
|
350 | - * required tag. They will be replaced accordingly with the right value. You |
|
351 | - * can use the full smarty syntax here, especially a custom modifier for I18N. |
|
352 | - * For example: |
|
353 | - * {if $required}<span style="color: red;">*</span>{/if}{$label|translate} |
|
354 | - * will put a red star in front of the label if the element is required and |
|
355 | - * translate the label. |
|
356 | - * |
|
357 | - * |
|
358 | - * @param string The required element template |
|
359 | - * @access public |
|
360 | - * @return void |
|
361 | - */ |
|
345 | + /** |
|
346 | + * Sets the way required elements are rendered |
|
347 | + * |
|
348 | + * You can use {$label} or {$html} placeholders to let the renderer know where |
|
349 | + * where the element label or the element html are positionned according to the |
|
350 | + * required tag. They will be replaced accordingly with the right value. You |
|
351 | + * can use the full smarty syntax here, especially a custom modifier for I18N. |
|
352 | + * For example: |
|
353 | + * {if $required}<span style="color: red;">*</span>{/if}{$label|translate} |
|
354 | + * will put a red star in front of the label if the element is required and |
|
355 | + * translate the label. |
|
356 | + * |
|
357 | + * |
|
358 | + * @param string The required element template |
|
359 | + * @access public |
|
360 | + * @return void |
|
361 | + */ |
|
362 | 362 | function setRequiredTemplate($template) |
363 | 363 | { |
364 | 364 | $this->_required = $template; |
365 | 365 | } // end func setRequiredTemplate |
366 | 366 | |
367 | - /** |
|
368 | - * Sets the way elements with validation errors are rendered |
|
369 | - * |
|
370 | - * You can use {$label} or {$html} placeholders to let the renderer know where |
|
371 | - * where the element label or the element html are positionned according to the |
|
372 | - * error message. They will be replaced accordingly with the right value. |
|
373 | - * The error message will replace the {$error} placeholder. |
|
374 | - * For example: |
|
375 | - * {if $error}<span style="color: red;">{$error}</span>{/if}<br />{$html} |
|
376 | - * will put the error message in red on top of the element html. |
|
377 | - * |
|
378 | - * If you want all error messages to be output in the main error block, use |
|
379 | - * the {$form.errors} part of the rendered array that collects all raw error |
|
380 | - * messages. |
|
381 | - * |
|
382 | - * If you want to place all error messages manually, do not specify {$html} |
|
383 | - * nor {$label}. |
|
384 | - * |
|
385 | - * Groups can have special layouts. With this kind of groups, you have to |
|
386 | - * place the formated error message manually. In this case, use {$form.group.error} |
|
387 | - * where you want the formated error message to appear in the form. |
|
388 | - * |
|
389 | - * @param string The element error template |
|
390 | - * @access public |
|
391 | - * @return void |
|
392 | - */ |
|
367 | + /** |
|
368 | + * Sets the way elements with validation errors are rendered |
|
369 | + * |
|
370 | + * You can use {$label} or {$html} placeholders to let the renderer know where |
|
371 | + * where the element label or the element html are positionned according to the |
|
372 | + * error message. They will be replaced accordingly with the right value. |
|
373 | + * The error message will replace the {$error} placeholder. |
|
374 | + * For example: |
|
375 | + * {if $error}<span style="color: red;">{$error}</span>{/if}<br />{$html} |
|
376 | + * will put the error message in red on top of the element html. |
|
377 | + * |
|
378 | + * If you want all error messages to be output in the main error block, use |
|
379 | + * the {$form.errors} part of the rendered array that collects all raw error |
|
380 | + * messages. |
|
381 | + * |
|
382 | + * If you want to place all error messages manually, do not specify {$html} |
|
383 | + * nor {$label}. |
|
384 | + * |
|
385 | + * Groups can have special layouts. With this kind of groups, you have to |
|
386 | + * place the formated error message manually. In this case, use {$form.group.error} |
|
387 | + * where you want the formated error message to appear in the form. |
|
388 | + * |
|
389 | + * @param string The element error template |
|
390 | + * @access public |
|
391 | + * @return void |
|
392 | + */ |
|
393 | 393 | function setErrorTemplate($template) |
394 | 394 | { |
395 | 395 | $this->_error = $template; |
@@ -174,15 +174,15 @@ discard block |
||
174 | 174 | unset($attr['name']); |
175 | 175 | |
176 | 176 | $html = $tabs.'<a href="'.$this->_options['callback'] |
177 | - .'" target="_blank" ' |
|
178 | - .$this->_getAttrString($attr) |
|
179 | - .' onclick="var cancelClick = false; ' |
|
180 | - .$this->getOnclickJs($imgName) |
|
181 | - .' return !cancelClick;"><img src="' |
|
182 | - .$this->_options['callback'].'" name="'.$imgName |
|
183 | - .'" id="'.$imgName.'" width="'.$this->_options['width'] |
|
184 | - .'" height="'.$this->_options['height'].'" title="' |
|
185 | - .htmlspecialchars($this->_options['alt']).'" /></a>'; |
|
177 | + .'" target="_blank" ' |
|
178 | + .$this->_getAttrString($attr) |
|
179 | + .' onclick="var cancelClick = false; ' |
|
180 | + .$this->getOnclickJs($imgName) |
|
181 | + .' return !cancelClick;"><img src="' |
|
182 | + .$this->_options['callback'].'" name="'.$imgName |
|
183 | + .'" id="'.$imgName.'" width="'.$this->_options['width'] |
|
184 | + .'" height="'.$this->_options['height'].'" title="' |
|
185 | + .htmlspecialchars($this->_options['alt']).'" /></a>'; |
|
186 | 186 | |
187 | 187 | return $html; |
188 | 188 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | .' var img = new Image();' |
204 | 204 | .' var d = new Date();' |
205 | 205 | .' img.src = this.href + ((this.href.indexOf(\'?\') == -1) ' |
206 | - .'? \'?\' : \'&\') + d.getTime();' |
|
206 | + .'? \'?\' : \'&\') + d.getTime();' |
|
207 | 207 | .' document.images[\''.addslashes($imageName).'\'].src = img.src;' |
208 | 208 | .' cancelClick = true;' |
209 | 209 | .'}'; |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | { |
38 | 38 | // {{{ properties |
39 | 39 | |
40 | - /** |
|
41 | - * Various options to control the element's display. |
|
42 | - * |
|
43 | - * @access private |
|
44 | - * @var array |
|
45 | - */ |
|
40 | + /** |
|
41 | + * Various options to control the element's display. |
|
42 | + * |
|
43 | + * @access private |
|
44 | + * @var array |
|
45 | + */ |
|
46 | 46 | var $_options = array( |
47 | 47 | 'language' => 'en', |
48 | 48 | 'format' => 'dMY', |
@@ -54,22 +54,22 @@ discard block |
||
54 | 54 | 'optionIncrement' => array('i' => 1, 's' => 1) |
55 | 55 | ); |
56 | 56 | |
57 | - /** |
|
58 | - * These complement separators, they are appended to the resultant HTML |
|
59 | - * @access private |
|
60 | - * @var array |
|
61 | - */ |
|
57 | + /** |
|
58 | + * These complement separators, they are appended to the resultant HTML |
|
59 | + * @access private |
|
60 | + * @var array |
|
61 | + */ |
|
62 | 62 | var $_wrap = array('', ''); |
63 | 63 | |
64 | - /** |
|
65 | - * Options in different languages |
|
66 | - * |
|
67 | - * Note to potential translators: to avoid encoding problems please send |
|
68 | - * your translations with "weird" letters encoded as HTML Unicode entities |
|
69 | - * |
|
70 | - * @access private |
|
71 | - * @var array |
|
72 | - */ |
|
64 | + /** |
|
65 | + * Options in different languages |
|
66 | + * |
|
67 | + * Note to potential translators: to avoid encoding problems please send |
|
68 | + * your translations with "weird" letters encoded as HTML Unicode entities |
|
69 | + * |
|
70 | + * @access private |
|
71 | + * @var array |
|
72 | + */ |
|
73 | 73 | var $_locale = array( |
74 | 74 | 'en' => array ( |
75 | 75 | 'weekdays_short'=> array ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'), |
@@ -232,43 +232,43 @@ discard block |
||
232 | 232 | // }}} |
233 | 233 | // {{{ constructor |
234 | 234 | |
235 | - /** |
|
236 | - * Class constructor |
|
237 | - * |
|
238 | - * The following keys may appear in $options array: |
|
239 | - * - 'language': date language |
|
240 | - * - 'format': Format of the date, based on PHP's date() function. |
|
241 | - * The following characters are currently recognised in format string: |
|
242 | - * <pre> |
|
243 | - * D => Short names of days |
|
244 | - * l => Long names of days |
|
245 | - * d => Day numbers |
|
246 | - * M => Short names of months |
|
247 | - * F => Long names of months |
|
248 | - * m => Month numbers |
|
249 | - * Y => Four digit year |
|
250 | - * y => Two digit year |
|
251 | - * h => 12 hour format |
|
252 | - * H => 23 hour format |
|
253 | - * i => Minutes |
|
254 | - * s => Seconds |
|
255 | - * a => am/pm |
|
256 | - * A => AM/PM |
|
257 | - * </pre> |
|
258 | - * - 'minYear': Minimum year in year select |
|
259 | - * - 'maxYear': Maximum year in year select |
|
260 | - * - 'addEmptyOption': Should an empty option be added to the top of |
|
261 | - * each select box? |
|
262 | - * - 'emptyOptionValue': The value passed by the empty option. |
|
263 | - * - 'emptyOptionText': The text displayed for the empty option. |
|
264 | - * - 'optionIncrement': Step to increase the option values by (works for 'i' and 's') |
|
265 | - * |
|
266 | - * @access public |
|
267 | - * @param string Element's name |
|
268 | - * @param mixed Label(s) for an element |
|
269 | - * @param array Options to control the element's display |
|
270 | - * @param mixed Either a typical HTML attribute string or an associative array |
|
271 | - */ |
|
235 | + /** |
|
236 | + * Class constructor |
|
237 | + * |
|
238 | + * The following keys may appear in $options array: |
|
239 | + * - 'language': date language |
|
240 | + * - 'format': Format of the date, based on PHP's date() function. |
|
241 | + * The following characters are currently recognised in format string: |
|
242 | + * <pre> |
|
243 | + * D => Short names of days |
|
244 | + * l => Long names of days |
|
245 | + * d => Day numbers |
|
246 | + * M => Short names of months |
|
247 | + * F => Long names of months |
|
248 | + * m => Month numbers |
|
249 | + * Y => Four digit year |
|
250 | + * y => Two digit year |
|
251 | + * h => 12 hour format |
|
252 | + * H => 23 hour format |
|
253 | + * i => Minutes |
|
254 | + * s => Seconds |
|
255 | + * a => am/pm |
|
256 | + * A => AM/PM |
|
257 | + * </pre> |
|
258 | + * - 'minYear': Minimum year in year select |
|
259 | + * - 'maxYear': Maximum year in year select |
|
260 | + * - 'addEmptyOption': Should an empty option be added to the top of |
|
261 | + * each select box? |
|
262 | + * - 'emptyOptionValue': The value passed by the empty option. |
|
263 | + * - 'emptyOptionText': The text displayed for the empty option. |
|
264 | + * - 'optionIncrement': Step to increase the option values by (works for 'i' and 's') |
|
265 | + * |
|
266 | + * @access public |
|
267 | + * @param string Element's name |
|
268 | + * @param mixed Label(s) for an element |
|
269 | + * @param array Options to control the element's display |
|
270 | + * @param mixed Either a typical HTML attribute string or an associative array |
|
271 | + */ |
|
272 | 272 | function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null) |
273 | 273 | { |
274 | 274 | $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes); |
@@ -412,15 +412,15 @@ discard block |
||
412 | 412 | // }}} |
413 | 413 | // {{{ _createOptionList() |
414 | 414 | |
415 | - /** |
|
416 | - * Creates an option list containing the numbers from the start number to the end, inclusive |
|
417 | - * |
|
418 | - * @param int The start number |
|
419 | - * @param int The end number |
|
420 | - * @param int Increment by this value |
|
421 | - * @access private |
|
422 | - * @return array An array of numeric options. |
|
423 | - */ |
|
415 | + /** |
|
416 | + * Creates an option list containing the numbers from the start number to the end, inclusive |
|
417 | + * |
|
418 | + * @param int The start number |
|
419 | + * @param int The end number |
|
420 | + * @param int Increment by this value |
|
421 | + * @access private |
|
422 | + * @return array An array of numeric options. |
|
423 | + */ |
|
424 | 424 | function _createOptionList($start, $end, $step = 1) |
425 | 425 | { |
426 | 426 | for ($i = $start, $options = array(); $start > $end? $i >= $end: $i <= $end; $i += $step) { |
@@ -432,12 +432,12 @@ discard block |
||
432 | 432 | // }}} |
433 | 433 | // {{{ _trimLeadingZeros() |
434 | 434 | |
435 | - /** |
|
436 | - * Trims leading zeros from the (numeric) string |
|
437 | - * |
|
438 | - * @param string A numeric string, possibly with leading zeros |
|
439 | - * @return string String with leading zeros removed |
|
440 | - */ |
|
435 | + /** |
|
436 | + * Trims leading zeros from the (numeric) string |
|
437 | + * |
|
438 | + * @param string A numeric string, possibly with leading zeros |
|
439 | + * @return string String with leading zeros removed |
|
440 | + */ |
|
441 | 441 | function _trimLeadingZeros($str) |
442 | 442 | { |
443 | 443 | if (0 == strcmp($str, $this->_options['emptyOptionValue'])) { |
@@ -35,121 +35,121 @@ |
||
35 | 35 | */ |
36 | 36 | class HTML_QuickForm_Renderer |
37 | 37 | { |
38 | - /** |
|
39 | - * Constructor |
|
40 | - * |
|
41 | - * @access public |
|
42 | - */ |
|
38 | + /** |
|
39 | + * Constructor |
|
40 | + * |
|
41 | + * @access public |
|
42 | + */ |
|
43 | 43 | function HTML_QuickForm_Renderer() |
44 | 44 | { |
45 | 45 | } // end constructor |
46 | 46 | |
47 | - /** |
|
48 | - * Called when visiting a form, before processing any form elements |
|
49 | - * |
|
50 | - * @param HTML_QuickForm a form being visited |
|
51 | - * @access public |
|
52 | - * @return void |
|
53 | - * @abstract |
|
54 | - */ |
|
47 | + /** |
|
48 | + * Called when visiting a form, before processing any form elements |
|
49 | + * |
|
50 | + * @param HTML_QuickForm a form being visited |
|
51 | + * @access public |
|
52 | + * @return void |
|
53 | + * @abstract |
|
54 | + */ |
|
55 | 55 | function startForm(&$form) |
56 | 56 | { |
57 | 57 | return; |
58 | 58 | } // end func startForm |
59 | 59 | |
60 | - /** |
|
61 | - * Called when visiting a form, after processing all form elements |
|
62 | - * |
|
63 | - * @param HTML_QuickForm a form being visited |
|
64 | - * @access public |
|
65 | - * @return void |
|
66 | - * @abstract |
|
67 | - */ |
|
60 | + /** |
|
61 | + * Called when visiting a form, after processing all form elements |
|
62 | + * |
|
63 | + * @param HTML_QuickForm a form being visited |
|
64 | + * @access public |
|
65 | + * @return void |
|
66 | + * @abstract |
|
67 | + */ |
|
68 | 68 | function finishForm(&$form) |
69 | 69 | { |
70 | 70 | return; |
71 | 71 | } // end func finishForm |
72 | 72 | |
73 | - /** |
|
74 | - * Called when visiting a header element |
|
75 | - * |
|
76 | - * @param HTML_QuickForm_header a header element being visited |
|
77 | - * @access public |
|
78 | - * @return void |
|
79 | - * @abstract |
|
80 | - */ |
|
73 | + /** |
|
74 | + * Called when visiting a header element |
|
75 | + * |
|
76 | + * @param HTML_QuickForm_header a header element being visited |
|
77 | + * @access public |
|
78 | + * @return void |
|
79 | + * @abstract |
|
80 | + */ |
|
81 | 81 | function renderHeader(&$header) |
82 | 82 | { |
83 | 83 | return; |
84 | 84 | } // end func renderHeader |
85 | 85 | |
86 | - /** |
|
87 | - * Called when visiting an element |
|
88 | - * |
|
89 | - * @param HTML_QuickForm_element form element being visited |
|
90 | - * @param bool Whether an element is required |
|
91 | - * @param string An error message associated with an element |
|
92 | - * @access public |
|
93 | - * @return void |
|
94 | - * @abstract |
|
95 | - */ |
|
86 | + /** |
|
87 | + * Called when visiting an element |
|
88 | + * |
|
89 | + * @param HTML_QuickForm_element form element being visited |
|
90 | + * @param bool Whether an element is required |
|
91 | + * @param string An error message associated with an element |
|
92 | + * @access public |
|
93 | + * @return void |
|
94 | + * @abstract |
|
95 | + */ |
|
96 | 96 | function renderElement(&$element, $required, $error) |
97 | 97 | { |
98 | 98 | return; |
99 | 99 | } // end func renderElement |
100 | 100 | |
101 | - /** |
|
102 | - * Called when visiting a hidden element |
|
103 | - * |
|
104 | - * @param HTML_QuickForm_element a hidden element being visited |
|
105 | - * @access public |
|
106 | - * @return void |
|
107 | - * @abstract |
|
108 | - */ |
|
101 | + /** |
|
102 | + * Called when visiting a hidden element |
|
103 | + * |
|
104 | + * @param HTML_QuickForm_element a hidden element being visited |
|
105 | + * @access public |
|
106 | + * @return void |
|
107 | + * @abstract |
|
108 | + */ |
|
109 | 109 | function renderHidden(&$element) |
110 | 110 | { |
111 | 111 | return; |
112 | 112 | } // end func renderHidden |
113 | 113 | |
114 | - /** |
|
115 | - * Called when visiting a raw HTML/text pseudo-element |
|
116 | - * |
|
117 | - * Only implemented in Default renderer. Usage of 'html' elements is |
|
118 | - * discouraged, templates should be used instead. |
|
119 | - * |
|
120 | - * @param HTML_QuickForm_html a 'raw html' element being visited |
|
121 | - * @access public |
|
122 | - * @return void |
|
123 | - * @abstract |
|
124 | - */ |
|
114 | + /** |
|
115 | + * Called when visiting a raw HTML/text pseudo-element |
|
116 | + * |
|
117 | + * Only implemented in Default renderer. Usage of 'html' elements is |
|
118 | + * discouraged, templates should be used instead. |
|
119 | + * |
|
120 | + * @param HTML_QuickForm_html a 'raw html' element being visited |
|
121 | + * @access public |
|
122 | + * @return void |
|
123 | + * @abstract |
|
124 | + */ |
|
125 | 125 | function renderHtml(&$data) |
126 | 126 | { |
127 | 127 | return; |
128 | 128 | } // end func renderHtml |
129 | 129 | |
130 | - /** |
|
131 | - * Called when visiting a group, before processing any group elements |
|
132 | - * |
|
133 | - * @param HTML_QuickForm_group A group being visited |
|
134 | - * @param bool Whether a group is required |
|
135 | - * @param string An error message associated with a group |
|
136 | - * @access public |
|
137 | - * @return void |
|
138 | - * @abstract |
|
139 | - */ |
|
130 | + /** |
|
131 | + * Called when visiting a group, before processing any group elements |
|
132 | + * |
|
133 | + * @param HTML_QuickForm_group A group being visited |
|
134 | + * @param bool Whether a group is required |
|
135 | + * @param string An error message associated with a group |
|
136 | + * @access public |
|
137 | + * @return void |
|
138 | + * @abstract |
|
139 | + */ |
|
140 | 140 | function startGroup(&$group, $required, $error) |
141 | 141 | { |
142 | 142 | return; |
143 | 143 | } // end func startGroup |
144 | 144 | |
145 | - /** |
|
146 | - * Called when visiting a group, after processing all group elements |
|
147 | - * |
|
148 | - * @param HTML_QuickForm_group A group being visited |
|
149 | - * @access public |
|
150 | - * @return void |
|
151 | - * @abstract |
|
152 | - */ |
|
145 | + /** |
|
146 | + * Called when visiting a group, after processing all group elements |
|
147 | + * |
|
148 | + * @param HTML_QuickForm_group A group being visited |
|
149 | + * @access public |
|
150 | + * @return void |
|
151 | + * @abstract |
|
152 | + */ |
|
153 | 153 | function finishGroup(&$group) |
154 | 154 | { |
155 | 155 | return; |
@@ -36,17 +36,17 @@ |
||
36 | 36 | */ |
37 | 37 | class HTML_QuickForm_Action |
38 | 38 | { |
39 | - /** |
|
40 | - * Processes the request. This method should be overriden by child classes to |
|
41 | - * provide the necessary logic. |
|
42 | - * |
|
43 | - * @access public |
|
44 | - * @param HTML_QuickForm_Page The current form-page |
|
45 | - * @param string Current action name, as one Action object |
|
46 | - * can serve multiple actions |
|
47 | - * @throws PEAR_Error |
|
48 | - * @abstract |
|
49 | - */ |
|
39 | + /** |
|
40 | + * Processes the request. This method should be overriden by child classes to |
|
41 | + * provide the necessary logic. |
|
42 | + * |
|
43 | + * @access public |
|
44 | + * @param HTML_QuickForm_Page The current form-page |
|
45 | + * @param string Current action name, as one Action object |
|
46 | + * can serve multiple actions |
|
47 | + * @throws PEAR_Error |
|
48 | + * @abstract |
|
49 | + */ |
|
50 | 50 | function perform(&$page, $actionName) |
51 | 51 | { |
52 | 52 | } |
@@ -37,59 +37,59 @@ discard block |
||
37 | 37 | */ |
38 | 38 | class HTML_QuickForm_Page extends HTML_QuickForm |
39 | 39 | { |
40 | - /** |
|
41 | - * Contains the mapping of actions to corresponding HTML_QuickForm_Action objects |
|
42 | - * @var array |
|
43 | - */ |
|
40 | + /** |
|
41 | + * Contains the mapping of actions to corresponding HTML_QuickForm_Action objects |
|
42 | + * @var array |
|
43 | + */ |
|
44 | 44 | var $_actions = array(); |
45 | 45 | |
46 | - /** |
|
47 | - * Contains a reference to a Controller object containing this page |
|
48 | - * @var HTML_QuickForm_Controller |
|
49 | - * @access public |
|
50 | - */ |
|
46 | + /** |
|
47 | + * Contains a reference to a Controller object containing this page |
|
48 | + * @var HTML_QuickForm_Controller |
|
49 | + * @access public |
|
50 | + */ |
|
51 | 51 | var $controller = null; |
52 | 52 | |
53 | - /** |
|
54 | - * Should be set to true on first call to buildForm() |
|
55 | - * @var bool |
|
56 | - */ |
|
53 | + /** |
|
54 | + * Should be set to true on first call to buildForm() |
|
55 | + * @var bool |
|
56 | + */ |
|
57 | 57 | var $_formBuilt = false; |
58 | 58 | |
59 | - /** |
|
60 | - * Class constructor |
|
61 | - * |
|
62 | - * @access public |
|
63 | - */ |
|
59 | + /** |
|
60 | + * Class constructor |
|
61 | + * |
|
62 | + * @access public |
|
63 | + */ |
|
64 | 64 | function HTML_QuickForm_Page($formName, $method = 'post', $target = '', $attributes = null) |
65 | 65 | { |
66 | 66 | $this->HTML_QuickForm($formName, $method, '', $target, $attributes); |
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | - /** |
|
71 | - * Registers a handler for a specific action. |
|
72 | - * |
|
73 | - * @access public |
|
74 | - * @param string name of the action |
|
75 | - * @param HTML_QuickForm_Action the handler for the action |
|
76 | - */ |
|
70 | + /** |
|
71 | + * Registers a handler for a specific action. |
|
72 | + * |
|
73 | + * @access public |
|
74 | + * @param string name of the action |
|
75 | + * @param HTML_QuickForm_Action the handler for the action |
|
76 | + */ |
|
77 | 77 | function addAction($actionName, &$action) |
78 | 78 | { |
79 | 79 | $this->_actions[$actionName] =& $action; |
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | - /** |
|
84 | - * Handles an action. |
|
85 | - * |
|
86 | - * If an Action object was not registered here, controller's handle() |
|
87 | - * method will be called. |
|
88 | - * |
|
89 | - * @access public |
|
90 | - * @param string Name of the action |
|
91 | - * @throws PEAR_Error |
|
92 | - */ |
|
83 | + /** |
|
84 | + * Handles an action. |
|
85 | + * |
|
86 | + * If an Action object was not registered here, controller's handle() |
|
87 | + * method will be called. |
|
88 | + * |
|
89 | + * @access public |
|
90 | + * @param string Name of the action |
|
91 | + * @throws PEAR_Error |
|
92 | + */ |
|
93 | 93 | function handle($actionName) |
94 | 94 | { |
95 | 95 | if (isset($this->_actions[$actionName])) { |
@@ -100,27 +100,27 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | |
103 | - /** |
|
104 | - * Returns a name for a submit button that will invoke a specific action. |
|
105 | - * |
|
106 | - * @access public |
|
107 | - * @param string Name of the action |
|
108 | - * @return string "name" attribute for a submit button |
|
109 | - */ |
|
103 | + /** |
|
104 | + * Returns a name for a submit button that will invoke a specific action. |
|
105 | + * |
|
106 | + * @access public |
|
107 | + * @param string Name of the action |
|
108 | + * @return string "name" attribute for a submit button |
|
109 | + */ |
|
110 | 110 | function getButtonName($actionName) |
111 | 111 | { |
112 | 112 | return '_qf_' . $this->getAttribute('id') . '_' . $actionName; |
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | - /** |
|
117 | - * Loads the submit values from the array. |
|
118 | - * |
|
119 | - * The method is NOT intended for general usage. |
|
120 | - * |
|
121 | - * @param array 'submit' values |
|
122 | - * @access public |
|
123 | - */ |
|
116 | + /** |
|
117 | + * Loads the submit values from the array. |
|
118 | + * |
|
119 | + * The method is NOT intended for general usage. |
|
120 | + * |
|
121 | + * @param array 'submit' values |
|
122 | + * @access public |
|
123 | + */ |
|
124 | 124 | function loadValues($values) |
125 | 125 | { |
126 | 126 | $this->_flagSubmitted = true; |
@@ -131,46 +131,46 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | - /** |
|
135 | - * Builds a form. |
|
136 | - * |
|
137 | - * You should override this method when you subclass HTML_QuickForm_Page, |
|
138 | - * it should contain all the necessary addElement(), applyFilter(), addRule() |
|
139 | - * and possibly setDefaults() and setConstants() calls. The method will be |
|
140 | - * called on demand, so please be sure to set $_formBuilt property to true to |
|
141 | - * assure that the method works only once. |
|
142 | - * |
|
143 | - * @access public |
|
144 | - * @abstract |
|
145 | - */ |
|
134 | + /** |
|
135 | + * Builds a form. |
|
136 | + * |
|
137 | + * You should override this method when you subclass HTML_QuickForm_Page, |
|
138 | + * it should contain all the necessary addElement(), applyFilter(), addRule() |
|
139 | + * and possibly setDefaults() and setConstants() calls. The method will be |
|
140 | + * called on demand, so please be sure to set $_formBuilt property to true to |
|
141 | + * assure that the method works only once. |
|
142 | + * |
|
143 | + * @access public |
|
144 | + * @abstract |
|
145 | + */ |
|
146 | 146 | function buildForm() |
147 | 147 | { |
148 | 148 | $this->_formBuilt = true; |
149 | 149 | } |
150 | 150 | |
151 | 151 | |
152 | - /** |
|
153 | - * Checks whether the form was already built. |
|
154 | - * |
|
155 | - * @access public |
|
156 | - * @return bool |
|
157 | - */ |
|
152 | + /** |
|
153 | + * Checks whether the form was already built. |
|
154 | + * |
|
155 | + * @access public |
|
156 | + * @return bool |
|
157 | + */ |
|
158 | 158 | function isFormBuilt() |
159 | 159 | { |
160 | 160 | return $this->_formBuilt; |
161 | 161 | } |
162 | 162 | |
163 | 163 | |
164 | - /** |
|
165 | - * Sets the default action invoked on page-form submit |
|
166 | - * |
|
167 | - * This is necessary as the user may just press Enter instead of |
|
168 | - * clicking one of the named submit buttons and then no action name will |
|
169 | - * be passed to the script. |
|
170 | - * |
|
171 | - * @access public |
|
172 | - * @param string default action name |
|
173 | - */ |
|
164 | + /** |
|
165 | + * Sets the default action invoked on page-form submit |
|
166 | + * |
|
167 | + * This is necessary as the user may just press Enter instead of |
|
168 | + * clicking one of the named submit buttons and then no action name will |
|
169 | + * be passed to the script. |
|
170 | + * |
|
171 | + * @access public |
|
172 | + * @param string default action name |
|
173 | + */ |
|
174 | 174 | function setDefaultAction($actionName) |
175 | 175 | { |
176 | 176 | if ($this->elementExists('_qf_default')) { |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | |
185 | - /** |
|
186 | - * Returns 'safe' elements' values |
|
187 | - * |
|
188 | - * @param mixed Array/string of element names, whose values we want. If not set then return all elements. |
|
189 | - * @param bool Whether to remove internal (_qf_...) values from the resultant array |
|
190 | - */ |
|
185 | + /** |
|
186 | + * Returns 'safe' elements' values |
|
187 | + * |
|
188 | + * @param mixed Array/string of element names, whose values we want. If not set then return all elements. |
|
189 | + * @param bool Whether to remove internal (_qf_...) values from the resultant array |
|
190 | + */ |
|
191 | 191 | function exportValues($elementList = null, $filterInternal = false) |
192 | 192 | { |
193 | 193 | $values = parent::exportValues($elementList); |