This is an implementation of a type of form control which both appears as a single element as well as supporting the selection of options. A combo box and drop down list are two such existing controls.
The functionality is implemented by extending a ControlElement to contain a ControlChoice. The ControlChoice interface is then implemented and calls are chained to the contained ControlChoice instance.
Definition at line 2692 of file controls.php.
Public Member Functions | |
SelectElement ($choice=null) | |
The SelectElement constructor. | |
setAttribute ($name, $value) | |
Set an attribute. | |
toXHTML () | |
Serialise the object to an XHTML string. | |
isSimpleControl () | |
Check whether this is a simple control. | |
submitsMultipleValues () | |
Check whether this control submits multiple values. | |
setId ($id) | |
Set the unique ID. | |
getValue () | |
Get the control's value. | |
setControlName ($name) | |
Set the control's name. | |
triggerActions () | |
Trigger all actions associated with the control. | |
eventHasOccurred ($event) | |
Check whether an event has occurred. | |
setControlClass ($control_class) | |
Set the class from which Options are instantiated. | |
getControlClass () | |
Get the class from which Options are instantiated. | |
& | addChoice ($value, $label=null, $selected=false) |
Add an Option. | |
selectedCount () | |
Get the number of currently selected controls. | |
getSelectedIds () | |
Get the currently selected Option IDs. | |
getSelectedControls () | |
Get the currently selected Options. | |
select ($id) | |
Select an Option by ID. | |
selected ($id) | |
Check whether an option is selected. | |
deselect ($id) | |
Deselect an Option. | |
triggerChildActions () | |
Trigger all actions of the contained controls. | |
& | getByValue ($value) |
Get a control that has a certain value. | |
& | get ($id) |
Get a control. | |
add (&$control) | |
Add a control. | |
exists ($id) | |
Check whether a control exists. | |
& | remove ($id) |
Remove and return a control. | |
getAllIds () | |
Get all control IDs. | |
getAllControls () | |
Get all controls. | |
getDisplayableIds () | |
Get the IDs of controls which can be displayed. | |
getDisplayableControls () | |
Get the controls which can be displayed. | |
childDisplay ($id) | |
Check whether a contained control can be displayed. | |
childToString ($id) | |
Get a string representation of a contained control. | |
childUpdated ($id) | |
Check whether a contained control has been updated. | |
__wakeup () | |
Initialise control after unserialisation. | |
__sleep () | |
Prepare object for serialisation. | |
Public Attributes | |
$controlchoice | |
The ControlChoice instance. |
|
The SelectElement constructor.
Definition at line 2701 of file controls.php. References select(). |
|
Prepare object for serialisation. This method is automatically called just before the object is serialised to carry out clean-up operations. See the PHP documentation at http://www.php.net/manual/en/language.oop.magic-functions.php for more information.
Reimplemented from ControlElement. Definition at line 3004 of file controls.php. |
|
Initialise control after unserialisation. Checks for a POST variable corresponding to this control and processes it if found.
Reimplemented from ControlElement. Definition at line 2993 of file controls.php. |
|
Add a control.
Definition at line 2903 of file controls.php. |
|
Add an Option.
Definition at line 2809 of file controls.php. References selected(). |
|
Check whether a contained control can be displayed.
Definition at line 2966 of file controls.php. |
|
Get a string representation of a contained control.
Definition at line 2975 of file controls.php. |
|
Check whether a contained control has been updated.
Definition at line 2984 of file controls.php. |
|
Deselect an Option.
Definition at line 2863 of file controls.php. |
|
Check whether an event has occurred.
Reimplemented from ControlElement. Definition at line 2772 of file controls.php. References FC_EVENT_UPDATE. |
|
Check whether a control exists.
Definition at line 2912 of file controls.php. |
|
Get a control.
Definition at line 2894 of file controls.php. |
|
Get all controls.
Definition at line 2939 of file controls.php. |
|
Get all control IDs.
Definition at line 2930 of file controls.php. |
|
Get a control that has a certain value. If a control has the specified value, it is returned. Only the first such matching control is returned.
Definition at line 2885 of file controls.php. |
|
Get the class from which Options are instantiated.
Definition at line 2799 of file controls.php. |
|
Get the controls which can be displayed.
Definition at line 2957 of file controls.php. |
|
Get the IDs of controls which can be displayed.
Definition at line 2948 of file controls.php. |
|
Get the currently selected Options.
Definition at line 2836 of file controls.php. |
|
Get the currently selected Option IDs.
Definition at line 2827 of file controls.php. |
|
Get the control's value. An interface for retrieving a control's value. This should be overridden in a subclass to return a value.
Reimplemented from ControlElement. Definition at line 2754 of file controls.php. |
|
Check whether this is a simple control. A simple control is a control that does not contain other controls.
Reimplemented from ControlElement. Definition at line 2738 of file controls.php. |
|
Remove and return a control.
Definition at line 2921 of file controls.php. |
|
Select an Option by ID.
Definition at line 2845 of file controls.php. Referenced by SelectElement(). |
|
Check whether an option is selected.
Definition at line 2854 of file controls.php. Referenced by addChoice(). |
|
Get the number of currently selected controls.
Definition at line 2818 of file controls.php. |
|
Set an attribute.
Reimplemented from XHTMLElement. Definition at line 2711 of file controls.php. |
|
Set the class from which Options are instantiated.
Definition at line 2789 of file controls.php. |
|
Set the control's name.
Reimplemented from ControlElement. Definition at line 2759 of file controls.php. |
|
Set the unique ID.
Reimplemented from ControlElement. Definition at line 2748 of file controls.php. |
|
Check whether this control submits multiple values. A control that submits multiple values is a control such as a checkbox or multiple select.
Reimplemented from ControlElement. Reimplemented in MultipleSelect. Definition at line 2743 of file controls.php. |
|
Serialise the object to an XHTML string.
Reimplemented from XHTMLElement. Definition at line 2721 of file controls.php. |
|
Trigger all actions associated with the control. ControlElement::triggerAction() is called for each of the control's actions.
Reimplemented from ControlElement. Definition at line 2766 of file controls.php. |
|
Trigger all actions of the contained controls.
Definition at line 2876 of file controls.php. |
|
The ControlChoice instance.
Definition at line 2695 of file controls.php. |