Moodle  2.2.1
http://www.collinsharper.com
HTML_QuickForm_Renderer_Default Class Reference
Inheritance diagram for HTML_QuickForm_Renderer_Default:
Collaboration diagram for HTML_QuickForm_Renderer_Default:

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 = ''

Detailed Description

A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one

public

Definition at line 31 of file Default.php.


Member Function Documentation

_prepareTemplate ( name,
label,
required,
error 
)

Helper method for renderElement

Parameters:
stringElement name
mixedElement label (if using an array of labels, you should set the appropriate template)
boolWhether an element is required
stringError message associated with the element private
See also:
renderElement()
Returns:
string Html for element

Definition at line 232 of file Default.php.

Here is the caller graph for this function:

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

Returns:
void

Definition at line 466 of file Default.php.

Here is the call graph for this function:

finishForm ( &$  form)

Called when visiting a form, after processing all form elements Adds required note, form attributes, validation javascript and form content.

Parameters:
objectAn HTML_QuickForm object being visited public
Returns:
void

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

Parameters:
objectAn HTML_QuickForm_group object being visited public
Returns:
void

Reimplemented from HTML_QuickForm_Renderer.

Definition at line 353 of file Default.php.

Constructor

public

Definition at line 144 of file Default.php.

Here is the call graph for this function:

Here is the caller graph for this function:

renderElement ( &$  element,
required,
error 
)

Renders an element Html Called when visiting an element

Parameters:
objectAn HTML_QuickForm_element object being visited
boolWhether an element is required
stringAn error message associated with an element public
Returns:
void

Reimplemented from HTML_QuickForm_Renderer.

Reimplemented in MoodleQuickForm_Renderer, and HTML_QuickForm_Renderer_Tableless.

Definition at line 281 of file Default.php.

Here is the call graph for this function:

renderHeader ( &$  header)

Called when visiting a header element

Parameters:
objectAn HTML_QuickForm_header element being visited public
Returns:
void

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

Parameters:
objectAn HTML_QuickForm_hidden object being visited public
Returns:
void

Reimplemented from HTML_QuickForm_Renderer.

Definition at line 310 of file Default.php.

renderHtml ( &$  data)

Called when visiting a raw HTML/text pseudo-element

Parameters:
objectAn HTML_QuickForm_html element being visited public
Returns:
void

Reimplemented from HTML_QuickForm_Renderer.

Definition at line 322 of file Default.php.

setElementTemplate ( html,
element = null 
)

Sets element template

Parameters:
stringThe HTML surrounding an element
string(optional) Name of the element to apply template for public
Returns:
void

Definition at line 383 of file Default.php.

Here is the caller graph for this function:

setFormTemplate ( html)

Sets form template

Parameters:
stringThe HTML surrounding the form tags public
Returns:
void

Definition at line 442 of file Default.php.

Here is the caller graph for this function:

setGroupElementTemplate ( html,
group 
)

Sets element template for elements within a group

Parameters:
stringThe HTML surrounding an element
stringName of the group to apply template for public
Returns:
void

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()

Parameters:
stringThe HTML surrounding group elements
stringName of the group to apply template for public
Returns:
void

Definition at line 405 of file Default.php.

setHeaderTemplate ( html)

Sets header template

Parameters:
stringThe HTML surrounding the header public
Returns:
void

Definition at line 430 of file Default.php.

Sets the note indicating required fields template

Parameters:
stringThe HTML surrounding the required note public
Returns:
void

Definition at line 454 of file Default.php.

Here is the caller graph for this function:

startForm ( &$  form)

Called when visiting a form, before processing any form elements

Parameters:
objectAn HTML_QuickForm object being visited public
Returns:
void

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

Parameters:
objectAn HTML_QuickForm_group object being visited
boolWhether a group is required
stringAn error message associated with a group public
Returns:
void

Reimplemented from HTML_QuickForm_Renderer.

Reimplemented in MoodleQuickForm_Renderer.

Definition at line 336 of file Default.php.

Here is the call graph for this function:

toHtml ( )

returns the HTML generated for the form

public

Returns:
string

Definition at line 155 of file Default.php.


Field Documentation

$_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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations