Creates an element with a dropdown Default/Custom and an input for the value (text or date_selector)
More...
|
| __construct ($elementname=null, $elementlabel=null, $options=array(), $attributes=null) |
| Constructor. More...
|
|
| _createElements () |
| This will create all elements in the group.
|
|
| accept (&$renderer, $required=false, $error=null) |
| Accepts a renderer. More...
|
|
| createFormElement () |
| Creates an element to add to the group Expects the same arguments as MoodleQuickForm::createElement()
|
|
| export_for_template (renderer_base $output) |
| Function to export the renderer data in a format that is suitable for a mustache template. More...
|
|
| exportValue (&$submitvalues, $assoc=false) |
| Output a value. More...
|
|
| freeze () |
|
| getElementTemplateType () |
| Returns element template, nodisplay/static/fieldset. More...
|
|
string | getHelpButton () |
| template type, would cause problems with client side validation so will leave for now More...
|
|
| MoodleQuickForm_group ($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName=true) |
| Old syntax of class constructor. More...
|
|
| onQuickFormEvent ($event, $arg, &$caller) |
| Called by HTML_QuickForm whenever form event is made on this element. More...
|
|
| setElements ($elements) |
| Sets the grouped elements and hides label. More...
|
|
| setMoodleForm ($mform) |
| Stores the form this element was added to This object is later used by MoodleQuickForm_group::createElement(). More...
|
|
| toHtml () |
|
| validateSubmitValue ($values) |
| Calls the validateSubmitValue function for the containing elements and returns an error string as soon as it finds one. More...
|
|
|
string | $_helpbutton ='' |
| html for help button, if empty then no help
|
|
|
MoodleQuickForm | $_mform = null |
|
array | $_options |
|
| $_renderedfromtemplate = false |
|
null bool | $_usedcreateelement = true |
| Keeps track of whether the date selector was initialised using createElement or addElement. More...
|
|
array | $_wrap = array('', '') |
| These complement separators, they are appended to the resultant HTML.
|
|
Creates an element with a dropdown Default/Custom and an input for the value (text or date_selector)
- Copyright
- 2017 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
MoodleQuickForm_defaultcustom::__construct |
( |
|
$elementname = null , |
|
|
|
$elementlabel = null , |
|
|
|
$options = array() , |
|
|
|
$attributes = null |
|
) |
| |
Constructor.
- Parameters
-
string | $elementname | Element's name |
mixed | $elementlabel | Label(s) for an element |
array | $options | Options to control the element's display |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
◆ accept()
MoodleQuickForm_defaultcustom::accept |
( |
& |
$renderer, |
|
|
|
$required = false , |
|
|
|
$error = null |
|
) |
| |
Accepts a renderer.
- Parameters
-
object | An HTML_QuickForm_Renderer object |
bool | Whether a group is required |
string | An error message associated with a group |
- Return values
-
Reimplemented from MoodleQuickForm_group.
◆ export_for_template()
MoodleQuickForm_group::export_for_template |
( |
renderer_base |
$output | ) |
|
|
inherited |
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
- No complex types - only stdClass, array, int, string, float, bool
- Any additional info that is required for the template is pre-calculated (e.g. capability checks).
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements templatable.
Reimplemented in MoodleQuickForm_date_selector, and MoodleQuickForm_date_time_selector.
◆ exportValue()
MoodleQuickForm_defaultcustom::exportValue |
( |
& |
$submitvalues, |
|
|
|
$assoc = false |
|
) |
| |
Output a value.
Give it the name of the group. In case of "default" return false.
- Parameters
-
array | $submitvalues | values submitted. |
bool | $assoc | specifies if returned array is associative |
- Return values
-
◆ getElementTemplateType()
MoodleQuickForm_group::getElementTemplateType |
( |
| ) |
|
|
inherited |
Returns element template, nodisplay/static/fieldset.
- Return values
-
◆ getHelpButton()
string MoodleQuickForm_group::getHelpButton |
( |
| ) |
|
|
inherited |
template type, would cause problems with client side validation so will leave for now
set html for help button
◆ has_customize_switch()
MoodleQuickForm_defaultcustom::has_customize_switch |
( |
| ) |
|
|
protected |
Should this element have default/custom switch?
- Return values
-
◆ MoodleQuickForm_group()
MoodleQuickForm_group::MoodleQuickForm_group |
( |
|
$elementName = null , |
|
|
|
$elementLabel = null , |
|
|
|
$elements = null , |
|
|
|
$separator = null , |
|
|
|
$appendName = true |
|
) |
| |
|
inherited |
Old syntax of class constructor.
Deprecated in PHP7.
- Deprecated:
- since Moodle 3.1
◆ onQuickFormEvent()
MoodleQuickForm_defaultcustom::onQuickFormEvent |
( |
|
$event, |
|
|
|
$arg, |
|
|
& |
$caller |
|
) |
| |
Called by HTML_QuickForm whenever form event is made on this element.
- Parameters
-
string | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
- Return values
-
Reimplemented from MoodleQuickForm_group.
◆ setElements()
MoodleQuickForm_group::setElements |
( |
|
$elements | ) |
|
|
inherited |
Sets the grouped elements and hides label.
- Parameters
-
◆ setMoodleForm()
MoodleQuickForm_group::setMoodleForm |
( |
|
$mform | ) |
|
|
inherited |
◆ timestamp_to_date_array()
MoodleQuickForm_defaultcustom::timestamp_to_date_array |
( |
|
$value | ) |
|
|
protected |
Converts timestamp to the day/month/year array in the current calendar format.
- Parameters
-
- Return values
-
◆ validateSubmitValue()
MoodleQuickForm_group::validateSubmitValue |
( |
|
$values | ) |
|
|
inherited |
Calls the validateSubmitValue function for the containing elements and returns an error string as soon as it finds one.
- Parameters
-
array | $values | Values of the containing elements. |
- Return values
-
string|null | Validation error message or null. |
Reimplemented in MoodleQuickForm_filetypes.
◆ $_usedcreateelement
null bool MoodleQuickForm_defaultcustom::$_usedcreateelement = true |
|
protected |
Keeps track of whether the date selector was initialised using createElement or addElement.
If true, createElement was used signifying the element has been added to a group - see MDL-39187.
The documentation for this class was generated from the following file: