Moodle  2.2.1
http://www.collinsharper.com
MoodleQuickForm_duration Class Reference
Inheritance diagram for MoodleQuickForm_duration:
Collaboration diagram for MoodleQuickForm_duration:

Public Member Functions

 MoodleQuickForm_duration ($elementName=null, $elementLabel=null, $options=array(), $attributes=null)
 get_units ()
 seconds_to_unit ($seconds)
 _createElements ()
 onQuickFormEvent ($event, $arg, $caller)
 toHtml ()
 accept ($renderer, $required=false, $error=null)
 exportValue ($submitValues, $notused=false)

Protected Attributes

 $_options = array('optional' => false, 'defaultunit' => 60)

Detailed Description

Definition at line 37 of file duration.php.


Member Function Documentation

Creates the group's elements.

This should be overriden by child classes that need to create their elements. The method will be called automatically when needed, calling it from the constructor is discouraged as the constructor is usually called _twice_ on element creation, first time with _no_ parameters.

private

Reimplemented from HTML_QuickForm_group.

Definition at line 110 of file duration.php.

Here is the call graph for this function:

accept ( renderer,
required = false,
error = null 
)

Definition at line 187 of file duration.php.

Here is the caller graph for this function:

exportValue ( submitValues,
notused = false 
)

Output a timestamp. Give it the name of the group. Override of standard quickforms method.

Parameters:
array$submitValues
bool$notusedNot used.
Returns:
array field name => value. The value is the time interval in seconds.

Definition at line 199 of file duration.php.

Here is the call graph for this function:

get_units ( )
Returns:
array unit length in seconds => string unit name.

Definition at line 80 of file duration.php.

Here is the caller graph for this function:

MoodleQuickForm_duration ( elementName = null,
elementLabel = null,
options = array(),
attributes = null 
)

Class constructor

public

Parameters:
string$elementNameElement's name
mixed$elementLabelLabel(s) for an element
array$optionsOptions to control the element's display. Recognised values are 'optional' => true/false - whether to display an 'enabled' checkbox next to the element. 'defaultunit' => 1|60|3600|86400 - the default unit to display when the time is blank. If not specified, minutes is used.
mixed$attributesEither a typical HTML attribute string or an associative array

Definition at line 57 of file duration.php.

Here is the call graph for this function:

onQuickFormEvent ( event,
arg,
caller 
)

Definition at line 134 of file duration.php.

Here is the call graph for this function:

seconds_to_unit ( seconds)
Parameters:
$secondsan amout of time in seconds.
Returns:
array($number, $unit) Conver an interval to the best possible unit. for example 1800 -> array(30, 60) = 30 minutes.

Definition at line 97 of file duration.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toHtml ( )

Returns Html for the group

Since:
1.0 public
Returns:
string

Reimplemented from HTML_QuickForm_group.

Definition at line 178 of file duration.php.

Here is the call graph for this function:


Field Documentation

$_options = array('optional' => false, 'defaultunit' => 60) [protected]

Control the fieldnames for form elements optional => if true, show a checkbox beside the element to turn it on (or off)

Definition at line 42 of file duration.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations