|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| HTML_QuickForm_Renderer_Default () | |
| toHtml () | |
| startForm (&$form) | |
| finishForm (&$form) | |
| renderHeader (&$header) | |
| _prepareTemplate ($name, $label, $required, $error) | |
| renderElement (&$element, $required, $error) | |
| renderHidden (&$element) | |
| renderHtml (&$data) | |
| startGroup (&$group, $required, $error) | |
| finishGroup (&$group) | |
| setElementTemplate ($html, $element=null) | |
| setGroupTemplate ($html, $group) | |
| setGroupElementTemplate ($html, $group) | |
| setHeaderTemplate ($html) | |
| setFormTemplate ($html) | |
| setRequiredNoteTemplate ($html) | |
| clearAllTemplates () | |
Data Fields | |
| $_html | |
| $_headerTemplate = "\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>" | |
| $_elementTemplate = "\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>" | |
| $_formTemplate = "\n<form{attributes}>\n<div>\n{hidden}<table border=\"0\">\n{content}\n</table>\n</div>\n</form>" | |
| $_requiredNoteTemplate = "\n\t<tr>\n\t\t<td></td>\n\t<td align=\"left\" valign=\"top\">{requiredNote}</td>\n\t</tr>" | |
| $_templates = array() | |
| $_groupWraps = array() | |
| $_groupTemplates = array() | |
| $_inGroup = false | |
| $_groupElements = array() | |
| $_groupElementTemplate = '' | |
| $_groupWrap = '' | |
| $_groupTemplate = '' | |
| $_hiddenHtml = '' | |
A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
public
Definition at line 31 of file Default.php.
| _prepareTemplate | ( | $ | name, |
| $ | label, | ||
| $ | required, | ||
| $ | error | ||
| ) |
Helper method for renderElement
| string | Element name |
| mixed | Element label (if using an array of labels, you should set the appropriate template) |
| bool | Whether an element is required |
| string | Error message associated with the element private |
Definition at line 232 of file Default.php.

Clears all the HTML out of the templates that surround notes, elements, etc. Useful when you want to use addData() to create a completely custom form look
public
Definition at line 466 of file Default.php.

| finishForm | ( | &$ | form | ) |
Called when visiting a form, after processing all form elements Adds required note, form attributes, validation javascript and form content.
| object | An HTML_QuickForm object being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 183 of file Default.php.
| finishGroup | ( | &$ | group | ) |
Called when visiting a group, after processing all group elements
| object | An HTML_QuickForm_group object being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Definition at line 353 of file Default.php.
Constructor
public
Definition at line 144 of file Default.php.


| renderElement | ( | &$ | element, |
| $ | required, | ||
| $ | error | ||
| ) |
Renders an element Html Called when visiting an element
| object | An HTML_QuickForm_element object being visited |
| bool | Whether an element is required |
| string | An error message associated with an element public |
Reimplemented from HTML_QuickForm_Renderer.
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 281 of file Default.php.

| renderHeader | ( | &$ | header | ) |
Called when visiting a header element
| object | An HTML_QuickForm_header element being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 211 of file Default.php.
| renderHidden | ( | &$ | element | ) |
Renders an hidden element Called when visiting a hidden element
| object | An HTML_QuickForm_hidden object being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Definition at line 310 of file Default.php.
| renderHtml | ( | &$ | data | ) |
Called when visiting a raw HTML/text pseudo-element
| object | An HTML_QuickForm_html element being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Definition at line 322 of file Default.php.
| setElementTemplate | ( | $ | html, |
| $ | element = null |
||
| ) |
Sets element template
| string | The HTML surrounding an element |
| string | (optional) Name of the element to apply template for public |
Definition at line 383 of file Default.php.

| setFormTemplate | ( | $ | html | ) |
Sets form template
| string | The HTML surrounding the form tags public |
Definition at line 442 of file Default.php.

| setGroupElementTemplate | ( | $ | html, |
| $ | group | ||
| ) |
Sets element template for elements within a group
| string | The HTML surrounding an element |
| string | Name of the group to apply template for public |
Definition at line 418 of file Default.php.
| setGroupTemplate | ( | $ | html, |
| $ | group | ||
| ) |
Sets template for a group wrapper
This template is contained within a group-as-element template set via setTemplate() and contains group's element templates, set via setGroupElementTemplate()
| string | The HTML surrounding group elements |
| string | Name of the group to apply template for public |
Definition at line 405 of file Default.php.
| setHeaderTemplate | ( | $ | html | ) |
Sets header template
| string | The HTML surrounding the header public |
Definition at line 430 of file Default.php.
| setRequiredNoteTemplate | ( | $ | html | ) |
Sets the note indicating required fields template
| string | The HTML surrounding the required note public |
Definition at line 454 of file Default.php.

| startForm | ( | &$ | form | ) |
Called when visiting a form, before processing any form elements
| object | An HTML_QuickForm object being visited public |
Reimplemented from HTML_QuickForm_Renderer.
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 169 of file Default.php.
| startGroup | ( | &$ | group, |
| $ | required, | ||
| $ | error | ||
| ) |
Called when visiting a group, before processing any group elements
| object | An HTML_QuickForm_group object being visited |
| bool | Whether a group is required |
| string | An error message associated with a group public |
Reimplemented from HTML_QuickForm_Renderer.
Reimplemented in MoodleQuickForm_Renderer.
Definition at line 336 of file Default.php.

| toHtml | ( | ) |
returns the HTML generated for the form
public
Definition at line 155 of file Default.php.
| $_elementTemplate = "\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>" |
Reimplemented in HTML_QuickForm_Renderer_Tableless.
Definition at line 53 of file Default.php.
| $_formTemplate = "\n<form{attributes}>\n<div>\n{hidden}<table border=\"0\">\n{content}\n</table>\n</div>\n</form>" |
Reimplemented in HTML_QuickForm_Renderer_Tableless.
Definition at line 61 of file Default.php.
| $_groupElements = array() |
Definition at line 109 of file Default.php.
| $_groupElementTemplate = '' |
Definition at line 116 of file Default.php.
| $_groupTemplate = '' |
Definition at line 130 of file Default.php.
| $_groupTemplates = array() |
Definition at line 95 of file Default.php.
| $_groupWrap = '' |
Definition at line 123 of file Default.php.
| $_groupWraps = array() |
Definition at line 88 of file Default.php.
| $_headerTemplate = "\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>" |
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 45 of file Default.php.
| $_hiddenHtml = '' |
Definition at line 137 of file Default.php.
| $_html |
Definition at line 38 of file Default.php.
| $_inGroup = false |
Definition at line 102 of file Default.php.
| $_requiredNoteTemplate = "\n\t<tr>\n\t\t<td></td>\n\t<td align=\"left\" valign=\"top\">{requiredNote}</td>\n\t</tr>" |
Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.
Definition at line 69 of file Default.php.
| $_templates = array() |
Definition at line 77 of file Default.php.