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

Public Member Functions

 HTML_QuickForm_date ($elementName=null, $elementLabel=null, $options=array(), $attributes=null)
 _createElements ()
 _createOptionList ($start, $end, $step=1)
 setValue ($value)
 toHtml ()
 accept (&$renderer, $required=false, $error=null)
 onQuickFormEvent ($event, $arg, &$caller)

Data Fields

 $_options
 $_wrap = array('', '')
 $_locale

Detailed Description

Class for a group of elements used to input dates (and times).

Inspired by original 'date' element but reimplemented as a subclass of HTML_QuickForm_group

Author:
Alexey Borzov <avb@php.net> public

Definition at line 35 of file date.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 294 of file date.php.

Here is the call graph for this function:

_createOptionList ( start,
end,
step = 1 
)

Creates an option list containing the numbers from the start number to the end, inclusive

Parameters:
intThe start number
intThe end number
intIncrement by this value private
Returns:
array An array of numeric options.

Definition at line 417 of file date.php.

Here is the caller graph for this function:

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

Accepts a renderer

Parameters:
objectAn HTML_QuickForm_Renderer object
boolWhether a group is required
stringAn error message associated with a group public
Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 475 of file date.php.

Here is the caller graph for this function:

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

Class constructor

public

Parameters:
stringElement's name
mixedLabel(s) for an element
arrayOptions to control the element's display
mixedEither a typical HTML attribute string or an associative array

Definition at line 269 of file date.php.

Here is the call graph for this function:

onQuickFormEvent ( event,
arg,
&$  caller 
)

Called by HTML_QuickForm whenever form event is made on this element

Parameters:
string$eventName of event
mixed$argevent arguments
object$callercalling object
Since:
1.0 public
Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 483 of file date.php.

setValue ( value)

Sets values for group's elements

Parameters:
mixedValues for group's elements
Since:
1.0 public
Returns:
void

Reimplemented from HTML_QuickForm_group.

Definition at line 428 of file date.php.

toHtml ( )

Returns Html for the group

Since:
1.0 public
Returns:
string

Reimplemented from HTML_QuickForm_group.

Definition at line 463 of file date.php.

Here is the call graph for this function:


Field Documentation

$_locale

Definition at line 98 of file date.php.

$_options
Initial value:
 array(
        'language'         => 'en',
        'format'           => 'dMY',
        'minYear'          => 2001,
        'maxYear'          => 2010,
        'addEmptyOption'   => false,
        'emptyOptionValue' => '',
        'emptyOptionText'  => '&nbsp;',
        'optionIncrement'  => array('i' => 1, 's' => 1)
    )

Definition at line 71 of file date.php.

$_wrap = array('', '')

Definition at line 87 of file date.php.


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