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

Public Member Functions

 __construct (moodle_url $url, $name, array $options, $selected='', $nothing=array(''=>'choosedots'), $formid=null)
 add_confirm_action ($confirmmessage)
 add_action (component_action $action)
 set_old_help_icon ($helppage, $title, $component= 'moodle')
 set_help_icon ($identifier, $component= 'moodle')
 set_label ($label)

Data Fields

 $url
 $name
 $options
 $selected
 $nothing
 $attributes = array()
 $label = ''
 $method = 'get'
 $class = 'singleselect'
 $disabled = false
 $tooltip = null
 $formid = null
 $helpicon = null

Detailed Description

Simple form with just one select field that gets submitted automatically. If JS not enabled small go button is printed too.

Since:
Moodle 2.0

Definition at line 589 of file outputcomponents.php.


Constructor & Destructor Documentation

__construct ( moodle_url url,
name,
array options,
selected = '',
nothing = array(''=>'choosedots'),
formid = null 
)

Constructor

Parameters:
moodle_url$urlform action target, includes hidden fields
string$namename of selection field - the changing parameter in url
array$optionslist of options
string$selectedselected element
array$nothing
string$formid

Definition at line 667 of file outputcomponents.php.


Member Function Documentation

Add action to the button.

Parameters:
component_action$action
Returns:
void

Definition at line 691 of file outputcomponents.php.

Here is the caller graph for this function:

add_confirm_action ( confirmmessage)

Shortcut for adding a JS confirm dialog when the button is clicked. The message must be a yes/no question.

Parameters:
string$messageThe yes/no confirmation question. If "Yes" is clicked, the original action will occur.
Returns:
void

Definition at line 682 of file outputcomponents.php.

Here is the call graph for this function:

set_help_icon ( identifier,
component = 'moodle' 
)

Adds help icon.

Parameters:
string$identifierThe keyword that defines a help page
string$component
bool$linktextadd extra text to icon
Returns:
void

Definition at line 714 of file outputcomponents.php.

set_label ( label)

Sets select's label

Parameters:
string$label
Returns:
void

Definition at line 723 of file outputcomponents.php.

Here is the caller graph for this function:

set_old_help_icon ( helppage,
title,
component = 'moodle' 
)

Adds help icon.

Parameters:
string$pageThe keyword that defines a help page
string$titleA descriptive text for accessibility only
string$component
bool$linktextadd extra text to icon
Returns:
void

Definition at line 703 of file outputcomponents.php.


Field Documentation

Definition at line 622 of file outputcomponents.php.

$class = 'singleselect'

Definition at line 637 of file outputcomponents.php.

$disabled = false

Definition at line 642 of file outputcomponents.php.

$formid = null

Definition at line 652 of file outputcomponents.php.

$helpicon = null

Definition at line 657 of file outputcomponents.php.

$label = ''

Definition at line 627 of file outputcomponents.php.

$method = 'get'

Definition at line 632 of file outputcomponents.php.

$name

Definition at line 599 of file outputcomponents.php.

$nothing

Definition at line 617 of file outputcomponents.php.

$options

Definition at line 607 of file outputcomponents.php.

$selected

Definition at line 612 of file outputcomponents.php.

$tooltip = null

Definition at line 647 of file outputcomponents.php.

$url

Definition at line 594 of file outputcomponents.php.


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