Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402]

Group of date input element Contains class for a group of elements used to input a date.

Copyright: 2007 Jamie Pratt <me@jamiep.org>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 307 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

MoodleQuickForm_date_selector:: (2 methods):
  __construct()
  MoodleQuickForm_date_selector()

name:: (6 methods):
  _createElements()
  onQuickFormEvent()
  toHtml()
  accept()
  export_for_template()
  exportValue()


Class: MoodleQuickForm_date_selector  - X-Ref

Class for a group of elements used to input a date.

Emulates moodle print_date_selector function

__construct($elementName = null, $elementLabel = null, $options = array()   X-Ref
constructor

param: string $elementName Element's name
param: mixed $elementLabel Label(s) for an element
param: array $options Options to control the element's display
param: mixed $attributes Either a typical HTML attribute string or an associative array

MoodleQuickForm_date_selector($elementName = null, $elementLabel = null, $options = array()   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

_createElements()   X-Ref
This will create date group element constisting of day, month and year.


onQuickFormEvent($event, $arg, &$caller)   X-Ref
Called by HTML_QuickForm whenever form event is made on this element

param: string $event Name of event
param: mixed $arg event arguments
param: object $caller calling object
return: bool

toHtml()   X-Ref
Returns HTML for advchecbox form element.

return: string

accept(&$renderer, $required = false, $error = null)   X-Ref
Accepts a renderer

param: HTML_QuickForm_Renderer $renderer An HTML_QuickForm_Renderer object
param: bool $required Whether a group is required
param: string $error An error message associated with a group

export_for_template(renderer_base $output)   X-Ref
Export for template

param: renderer_base $output
return: array|stdClass

exportValue(&$submitValues, $assoc = false)   X-Ref
Output a timestamp. Give it the name of the group.

param: array $submitValues values submitted.
param: bool $assoc specifies if returned array is associative
return: array