Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
MoodleQuickForm_Renderer Class Reference

MoodleQuickForm renderer. More...

Inheritance diagram for MoodleQuickForm_Renderer:

Public Member Functions

 __construct ()
 Constructor.
 
moodle_page finishForm (&$form)
 Called when visiting a form, after processing all form elements Adds required note, form attributes, validation javascript and form content. More...
 
 getStopFieldsetElements ()
 Return Array of element names that indicate the end of a fieldset. More...
 
 MoodleQuickForm_Renderer ()
 Old syntax of class constructor. More...
 
 renderElement (&$element, $required, $error)
 Renders element. More...
 
moodle_page renderHeader (&$header)
 Called when visiting a header element. More...
 
 setAdvancedElements ($elements)
 Set element's as adavance element. More...
 
 setCollapsibleElements ($elements)
 Setting collapsible elements. More...
 
 startForm (&$form)
 What to do when starting the form. More...
 
 startGroup (&$group, $required, $error)
 Create advance group of elements. More...
 

Public Attributes

array $_advancedElements = array()
 Array whose keys are element names. More...
 
string $_closeFieldsetTemplate = "\n\t\t</div></fieldset>"
 Template used when closing a fieldset.
 
string $_collapseButtons = ''
 Contains the collapsible buttons to add to the form.
 
string $_collapseButtonsTemplate
 Collapsible buttons string template. More...
 
array $_collapsibleElements = array()
 Array whose keys are element names and the the boolean values reflect the current state. More...
 
array $_elementTemplates
 Element template array.
 
string $_headerTemplate
 Header Template string. More...
 
string $_openFieldsetTemplate = "\n\t<fieldset class=\"{classes}\" {id}>"
 Template used when opening a fieldset.
 
string $_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\"><div>"
 Template used when opening a hidden fieldset (i.e. More...
 
string $_requiredNoteTemplate
 Required Note template string. More...
 

Detailed Description

MoodleQuickForm renderer.

A renderer for MoodleQuickForm that only uses XHTML and CSS and no table tags, extends PEAR class HTML_QuickForm_Renderer_Tableless

Stylesheet is part of standard theme and should be automatically included.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ finishForm()

moodle_page MoodleQuickForm_Renderer::finishForm ( $form)

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

$PAGE

Parameters
moodleform$formPassed by reference

◆ getStopFieldsetElements()

MoodleQuickForm_Renderer::getStopFieldsetElements ( )

Return Array of element names that indicate the end of a fieldset.

Return values
array

◆ MoodleQuickForm_Renderer()

MoodleQuickForm_Renderer::MoodleQuickForm_Renderer ( )

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ renderElement()

MoodleQuickForm_Renderer::renderElement ( $element,
  $required,
  $error 
)

Renders element.

Parameters
HTML_QuickForm_element$elementelement
bool$requiredif input is required field
string$errorerror message to display

◆ renderHeader()

moodle_page MoodleQuickForm_Renderer::renderHeader ( $header)

Called when visiting a header element.

Parameters
HTML_QuickForm_header$headerAn HTML_QuickForm_header element being visited $PAGE

◆ setAdvancedElements()

MoodleQuickForm_Renderer::setAdvancedElements (   $elements)

Set element's as adavance element.

Parameters
array$elementsform elements which needs to be grouped as advance elements.

◆ setCollapsibleElements()

MoodleQuickForm_Renderer::setCollapsibleElements (   $elements)

Setting collapsible elements.

Parameters
array$elements

◆ startForm()

MoodleQuickForm_Renderer::startForm ( $form)

What to do when starting the form.

Parameters
MoodleQuickForm$formreference of the form

◆ startGroup()

MoodleQuickForm_Renderer::startGroup ( $group,
  $required,
  $error 
)

Create advance group of elements.

Parameters
MoodleQuickForm_group$groupPassed by reference
bool$requiredif input is required field
string$errorerror message to display

Member Data Documentation

◆ $_advancedElements

array MoodleQuickForm_Renderer::$_advancedElements = array()

Array whose keys are element names.

If the key exists this is a advanced element

◆ $_collapseButtonsTemplate

string MoodleQuickForm_Renderer::$_collapseButtonsTemplate
Initial value:
=
"\n\t<div class=\"collapsible-actions\"><span class=\"collapseexpand\">{strexpandall}</span></div>"

Collapsible buttons string template.

Note that the will be converted as a link. This is done so that the link is not yet clickable until the Javascript has been fully loaded.

◆ $_collapsibleElements

array MoodleQuickForm_Renderer::$_collapsibleElements = array()

Array whose keys are element names and the the boolean values reflect the current state.

If the key exists this is a collapsible element.

◆ $_headerTemplate

string MoodleQuickForm_Renderer::$_headerTemplate
Initial value:
=
"\n\t\t<legend class=\"ftoggler\">{header}</legend>\n\t\t<div class=\"fcontainer clearfix\">\n\t\t"

Header Template string.

◆ $_openHiddenFieldsetTemplate

string MoodleQuickForm_Renderer::$_openHiddenFieldsetTemplate = "\n\t<fieldset class=\"hidden\"><div>"

Template used when opening a hidden fieldset (i.e.

a fieldset that is opened when there is no header element)

◆ $_requiredNoteTemplate

string MoodleQuickForm_Renderer::$_requiredNoteTemplate
Initial value:
=
"\n\t\t<div class=\"fdescription required\">{requiredNote}</div>"

Required Note template string.


The documentation for this class was generated from the following file: