Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

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
File Size: 279 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MoodleQuickForm_defaultcustom:: (9 methods):
  __construct()
  timestamp_to_date_array()
  has_customize_switch()
  _createElements()
  onQuickFormEvent()
  freeze()
  toHtml()
  accept()
  exportValue()


Class: MoodleQuickForm_defaultcustom  - X-Ref

Creates an element with a dropdown Default/Custom and an input for the value (text or date_selector)

__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

timestamp_to_date_array($value)   X-Ref
Converts timestamp to the day/month/year array in the current calendar format

param: int $value
return: array

has_customize_switch()   X-Ref
Should this element have default/custom switch?

return: bool

_createElements()   X-Ref
This will create all elements in the group


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

freeze()   X-Ref
No description

toHtml()   X-Ref
No description

accept(&$renderer, $required = false, $error = null)   X-Ref
No description

exportValue(&$submitvalues, $assoc = false)   X-Ref
Output a value. Give it the name of the group. In case of "default" return false.

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