Element used to input a date and time.
More...
|
| __construct ($elementName=null, $elementLabel=null, $options=array(), $attributes=null) |
| Class constructor.
|
|
| accept (&$renderer, $required=false, $error=null) |
| Accepts a renderer.
|
|
| createFormElement () |
| Creates an element to add to the group Expects the same arguments as MoodleQuickForm\createElement()
|
|
| export_for_template (renderer_base $output) |
| Export for template.
|
|
| exportValue (&$submitValues, $assoc=false) |
| Output a timestamp.
|
|
| getAttributesForFormElement () |
| Return attributes suitable for passing to {.
|
|
| getElementTemplateType () |
| Returns element template, nodisplay/static/fieldset.
|
|
string | getHelpButton () |
| template type, would cause problems with client side validation so will leave for now
|
|
| MoodleQuickForm_date_time_selector ($elementName=null, $elementLabel=null, $options=array(), $attributes=null) |
| Old syntax of class constructor.
|
|
| MoodleQuickForm_group ($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName=true) |
| Old syntax of class constructor.
|
|
| onQuickFormEvent ($event, $arg, &$caller) |
| Called by HTML_QuickForm whenever form event is made on this element.
|
|
| setElements ($elements) |
| Sets the grouped elements and hides label.
|
|
| setHiddenLabel ($hiddenLabel) |
| Sets label to be hidden.
|
|
| setMoodleForm ($mform) |
| Stores the form this element was added to This object is later used by MoodleQuickForm_group::createElement().
|
|
| toHtml () |
| Returns HTML for advchecbox form element.
|
|
| validateSubmitValue ($values) |
| Calls the validateSubmitValue function for the containing elements and returns an error string as soon as it finds one.
|
|
|
string | $_helpbutton ='' |
| html for help button, if empty then no help
|
|
|
bool | $_hiddenLabel = false |
| if true label will be hidden.
|
|
MoodleQuickForm | $_mform = null |
|
array | $_options = array() |
| Options for the element.
|
|
| $_renderedfromtemplate = false |
|
null bool | $_usedcreateelement = true |
| Keeps track of whether the date selector was initialised using createElement or addElement.
|
|
array | $_wrap = array('', '') |
| These complement separators, they are appended to the resultant HTML.
|
|
Element used to input a date and time.
Class for a group of elements used to input a date and time.
- Copyright
- 2006 Jamie Pratt me@ja.nosp@m.miep.nosp@m..org
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
MoodleQuickForm_date_time_selector::__construct |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $options = array(), |
|
|
| $attributes = null ) |
Class 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_date_time_selector::accept |
( |
& | $renderer, |
|
|
| $required = false, |
|
|
| $error = null ) |
Accepts a renderer.
- Parameters
-
HTML_QuickForm_Renderer | $renderer | An HTML_QuickForm_Renderer object |
bool | $required | Whether a group is required |
string | $error | An error message associated with a group |
Reimplemented from MoodleQuickForm_group.
◆ export_for_template()
MoodleQuickForm_date_time_selector::export_for_template |
( |
renderer_base | $output | ) |
|
◆ exportValue()
MoodleQuickForm_date_time_selector::exportValue |
( |
& | $submitValues, |
|
|
| $assoc = false ) |
Output a timestamp.
Give it the name of the group.
- Parameters
-
array | $submitValues | values submitted. |
bool | $assoc | specifies if returned array is associative |
- Return values
-
◆ getAttributesForFormElement()
MoodleQuickForm_group::getAttributesForFormElement |
( |
| ) |
|
|
inherited |
Return attributes suitable for passing to {.
- See also
- createFormElement}, comprised of all group attributes without ID in order to ensure uniqueness of that value within the group
- 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
◆ MoodleQuickForm_date_time_selector()
MoodleQuickForm_date_time_selector::MoodleQuickForm_date_time_selector |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $options = array(), |
|
|
| $attributes = null ) |
Old syntax of class constructor.
Deprecated in PHP7.
- Deprecated
- since Moodle 3.1
◆ 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_date_time_selector::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
-
◆ setHiddenLabel()
MoodleQuickForm_group::setHiddenLabel |
( |
| $hiddenLabel | ) |
|
|
inherited |
Sets label to be hidden.
- Parameters
-
bool | $hiddenLabel | sets if label should be hidden |
◆ setMoodleForm()
MoodleQuickForm_group::setMoodleForm |
( |
| $mform | ) |
|
|
inherited |
◆ toHtml()
MoodleQuickForm_date_time_selector::toHtml |
( |
| ) |
|
Returns HTML for advchecbox form element.
- 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.
◆ $_options
array MoodleQuickForm_date_time_selector::$_options = array() |
|
protected |
Options for the element.
startyear => int start of range of years that can be selected stopyear => int last year that can be selected defaulttime => default time value if the field is currently not set timezone => int|float|string (optional) timezone modifier used for edge case only. If not specified, then date is caclulated based on current user timezone. Note: dst will be calculated for string timezones only step => step to increment minutes by optional => if true, show a checkbox beside the date to turn it on (or off)
◆ $_usedcreateelement
null bool MoodleQuickForm_date_time_selector::$_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: