CWIS Developer Documentation
|
Convenience class for generating an HTML select/option form element. More...
Public Member Functions | |
__construct ($ResultVar, $Options, $SelectedValue=NULL) | |
Class constructor. More... | |
PrintHtml () | |
Print HTML for list. More... | |
GetHtml () | |
Get HTML for list. More... | |
DisabledOptions ($Options=NULL) | |
Get/set disabled options. More... | |
SelectedValue ($NewValue=NULL) | |
Get/set currently selected value or array of currently selected values. More... | |
Size ($NewValue=NULL) | |
Get/set the list size (number of visible items). More... | |
MultipleAllowed ($NewValue=NULL) | |
Get/set whether multiple items may be selected. More... | |
SubmitOnChange ($NewValue=NULL) | |
Get/set whether to submit the form when the list value is changed. More... | |
OnChangeAction ($NewValue=NULL) | |
Get/set action to take if form is submitted on change. More... | |
PrintIfEmpty ($NewValue=NULL) | |
Get/set whether list should be output even if there are no items. More... | |
Disabled ($NewValue=NULL) | |
Get/set whether the whole option list is editable. More... | |
Convenience class for generating an HTML select/option form element.
Definition at line 13 of file HtmlOptionList.php.
HtmlOptionList::__construct | ( | $ResultVar, | |
$Options, | |||
$SelectedValue = NULL |
|||
) |
Class constructor.
string | $ResultVar | Name of form variable for select element. |
array | $Options | Array of options, with form values for the array index and labels for the array values. |
mixed | $SelectedValue | Currently selected form value or array of currently selected form values. (OPTIONAL) |
Definition at line 26 of file HtmlOptionList.php.
References SelectedValue().
HtmlOptionList::Disabled | ( | $NewValue = NULL | ) |
Get/set whether the whole option list is editable.
NOTE: When the list is not editable, values for it are not submitted with the form. This is distinct from whether individual options are disabled.
bool | $NewValue | If TRUE, list is not editable. |
Definition at line 242 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::DisabledOptions | ( | $Options = NULL | ) |
Get/set disabled options.
mixed | $Options | Option or array of options to disable. If a single option then it should be the value and will be added to any existing disabled options, and if an array it should have the values for the index and will replace the current list of disabled options. (OPTIONAL) |
Definition at line 108 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::GetHtml | ( | ) |
Get HTML for list.
Definition at line 45 of file HtmlOptionList.php.
References Disabled(), DisabledOptions(), MultipleAllowed(), OnChangeAction(), PrintIfEmpty(), SelectedValue(), Size(), and SubmitOnChange().
Referenced by PrintHtml().
HtmlOptionList::MultipleAllowed | ( | $NewValue = NULL | ) |
Get/set whether multiple items may be selected.
Defaults to FALSE.
bool | $NewValue | If TRUE, users will be able to select multiple items. (OPTIONAL) |
Definition at line 159 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::OnChangeAction | ( | $NewValue = NULL | ) |
Get/set action to take if form is submitted on change.
Defaults to "submit()" (without the quotes). No character escaping or other processing is done to this value before it is added to the HTML, so whatever is passed in must be pre-sanitized if needed, including escaping any double quotation marks. This setting has no effect if SubmitOnChange() is set to FALSE.
string | $NewValue | New action. (OPTIONAL) |
Definition at line 208 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::PrintHtml | ( | ) |
HtmlOptionList::PrintIfEmpty | ( | $NewValue = NULL | ) |
Get/set whether list should be output even if there are no items.
If this is set to FALSE and there are no items in the list, GetHtml() will return an empty string and PrintHtml() will print nothing. Defaults to TRUE.
bool | $NewValue | If TRUE, HTML will be returned/printed even if there are no items in the list. (OPTIONAL) |
Definition at line 226 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::SelectedValue | ( | $NewValue = NULL | ) |
Get/set currently selected value or array of currently selected values.
mixed | $NewValue | Currently selected form value or array of currently selected form values. (OPTIONAL) |
Definition at line 130 of file HtmlOptionList.php.
Referenced by __construct(), and GetHtml().
HtmlOptionList::Size | ( | $NewValue = NULL | ) |
Get/set the list size (number of visible items).
Defaults to 1.
int | $NewValue | Current size. (OPTIONAL) |
Definition at line 144 of file HtmlOptionList.php.
Referenced by GetHtml().
HtmlOptionList::SubmitOnChange | ( | $NewValue = NULL | ) |
Get/set whether to submit the form when the list value is changed.
Defaults to FALSE.
bool | $NewValue | If TRUE, form will be submitted on change. (OPTIONAL) |
Definition at line 188 of file HtmlOptionList.php.
Referenced by GetHtml().