checkBox()
checkBoxUnit()
comboBox()
comboBoxUnit()
controlUnit()
form()
getListItemId()
listItem()
mergeOptionArrays()
password()
passwordUnit()
popup()
radio()
radioUnit()
resetControlCounter()
select()
selectUnit()
spinBox()
spinBoxUnit()
submitUnit()
textBox()
textBoxUnit()
upload()
uploadUnit()
_appendClasses()
_getCheckBoxGroupHtml()
_getCheckBoxInput()
_getCheckBoxOptionHtml()
_getComboBoxGroupHtml()
_getComboBoxInput()
_getComboBoxOptionHtml()
_getControlId()
_getDataAttributesAsString()
_getDisablerHtml()
_getRadioGroupHtml()
_getRadioInput()
_getRadioOptionHtml()
_getSelectGroupHtml()
_getSelectInput()
_getSelectOptionHtml()
_getSpinBoxInput()
_getTextInput()
_getUploadInput()
_processControlChoices()
_wrapControlUnit()
__construct()
$_controlCounter
$_controlIdLog
$_listItemGroupCounter
$_oneUseId
Helper methods for the admin template functions/tags.
package | XenForo_Template |
---|
checkBox(string $name, array $choices, array $controlOptions) : string
string
Default name of the chec kbox. If used, [] will be appended.
array
Choices for the check box
array
Options that relate to the check box controls
string
checkBoxUnit(string $label, string $name, array $choices, array $rowOptions, array $controlOptions) : string
string
Label for the unit
string
Default name of the chec kbox. If used, [] will be appended.
array
Choices for the check box
array
Options that relate to the whole row
array
Options that relate to the check box controls
string
comboBox(string $name, string $value, array $choices, array $controlOptions) : string
string
Name of the text box
string
Default value for the text box
array
Choices for the select
array
Options that relate to the text/select controls
string
comboBoxUnit(string $label, string $name, string $value, array $choices, array $rowOptions, array $controlOptions) : string
string
Label for the unit
string
Name of the text box
string
Default value for the text box
array
Choices for the select
array
Options that relate to the whole row
array
Options that relate to the text/select controls
string
controlUnit(string $label, array $rowOptions) : string
This does not contain any input field unless you manually include one. Note that the label will not be "for" any input.
string
Label text
array
Collection of options that relate to the row
string
form(string $childElements, array $options) : string
string
Child elements
array
string
getListItemId(mixed $id) : string
mixed
string
listItem(array $controlOptions, array $popups) : string
array
Options relating to the item
array
A list of popups (HTML) that belong to the item
string
List row HTMLmergeOptionArrays(array $start, array $additional, boolean $raw) : array
"Simple" form (value => label) data will be translated into a simple array format to be unambiguous.
array
The base array
array
The data to add to the base array. Ignored if not an array.
boolean
If true, escaping is not done on printable components
array
password(string $name, string $value, array $controlOptions) : string
string
Name of the text box
string
Default value of the text box
array
Options that relate to the control
string
passwordUnit(string $label, string $name, string $value, array $rowOptions, array $controlOptions) : string
string
Label for the row
string
Name of the text box
string
Default value of the text box
array
Options that relate to the row
array
Options that relate to the control
string
popup(array $controlOptions, array $choices, string $wrapTag, string $extraMenuClass) : string
array
Options for the control
array
Choices within the popup; each will be an li
string
Tag to wrap menu in (div or ul, for example)
string
An extra class (or multiple) set as the menu class
string
Popup HTMLradio(string $name, string $value, array $choices, array $controlOptions) : string
string
Name of the radios
string
Selected value for the radio
array
Choices for the radios
array
Options that relate to the radio controls
string
radioUnit(string $label, string $name, string $value, array $choices, array $rowOptions, array $controlOptions) : string
string
Label for the unit
string
Name of the radios
string
Selected value for the radio
array
Choices for the radios
array
Options that relate to the whole row
array
Options that relate to the radio controls
string
resetControlCounter()
This may cause duplicate IDs. Primarily used for testing.
select(string $name, string $value, array $choices, array $controlOptions) : string
string
Name of the select
string
Selected value for the select
array
Choices for the select
array
Options that relate to the select control
string
selectUnit(string $label, string $name, string $value, array $choices, array $rowOptions, array $controlOptions) : string
string
Label for the unit
string
Name of the select
string
Selected value for the select
array
Choices for the select
array
Options that relate to the whole row
array
Options that relate to the select control
string
spinBox(string $name, string $value, array $controlOptions) : string
string
Name of the text box
string
Default value of the text box
array
Options that relate to the control
string
spinBoxUnit(string $label, string $name, string $value, array $rowOptions, array $controlOptions) : string
string
Label for the row
string
Name of the text box
string
Default value of the text box
array
Options that relate to the row
array
Options that relate to the control
string
submitUnit(string $childText, array $controlOptions) : string
string
Output from text that was within the submitunit tag
array
Options for this control
string
textBox(string $name, string $value, array $controlOptions) : string
string
Name of the text box
string
Default value of the text box
array
Options that relate to the control
string
textBoxUnit(string $label, string $name, string $value, array $rowOptions, array $controlOptions) : string
string
Label for the row
string
Name of the text box
string
Default value of the text box
array
Options that relate to the row
array
Options that relate to the control
string
upload(string $name, string $value, array $controlOptions) : string
string
Name of the input
string
Default value of the text box (likely ignored)
array
Options that relate to the control
string
uploadUnit(string $label, string $name, string $value, array $rowOptions, array $controlOptions) : string
string
Label for the row
string
Name of the input
string
Default value of the upload box (likely ignored by browsers)
array
Options that relate to the row
array
Options that relate to the control
string
_appendClasses(array $array, string $key, string $append) : array
List must be within an array.
array
Array that contains the list
string
Key of the list
string
Classes to appended. Separate with spaces.
array
Original array, updated_getCheckBoxGroupHtml(\$label $label, \$optionHtml $optionHtml) : string
At this time, optgroups are ignored.
\$label
Label for the group
\$optionHtml
HTML for the options within the group
string
_getCheckBoxInput(string $name, array $choices, array $controlOptions) : string
string
Default name of the check box. If used, [] will be appended.
array
Choices for the check box
array
Control options
string
_getCheckBoxOptionHtml(string $value, string $label, boolean $selected, array $extra, array $options) : string
string
Value for the option (what it submitted to the server)
string
Label for the option (printable)
boolean
Whether this option is selected
array
Extra data about the check box
array
Parsing options
string
_getComboBoxGroupHtml(\$label $label, \$optionHtml $optionHtml) : string
\$label
Label for the group
\$optionHtml
HTML for the options within the group
string
_getComboBoxInput(string $name, string $value, array $choices, array $controlOptions, string $id) : string
string
Name of the select input. If multiple selections are allow, [] will be appended.
string
Default selected option
array
Choices for the select
array
Control options
string
Optional ID for the input. If not specified, one will be generated.
string
_getComboBoxOptionHtml(string $value, string $label) : string
string
Value for the option (what it submitted to the server)
string
Label for the option (printable)
string
_getControlId(string $name, array $controlOptions) : string
string
Name of the control. Will be used to generate the ID if possible and not overridden.
string
_getDataAttributesAsString(array $options) : string
The given array should be all options, not just the data array.
array
All options, possibly including a _data key.
string
Attributes AS string, with a leading space if there are attributes_getDisablerHtml(array $optionInfo, string $optionId) : string
array
Information about the option. Disablers searched for in "disabled" key.
string
ID that is being used for the parent of the disabler
string
HTML for the disabled controls, if applicable_getRadioGroupHtml(\$label $label, \$optionHtml $optionHtml) : string
At this time, optgroups are ignored.
\$label
Label for the group
\$optionHtml
HTML for the options within the group
string
_getRadioInput(string $name, string $value, array $choices, array $controlOptions) : string
string
Name of the radop inputs.
string
Default selected option
array
Choices for the radios
array
Control options
string
_getRadioOptionHtml(string $value, string $label, boolean $selected, array $extra, array $options) : string
string
Value for the option (what it submitted to the server)
string
Label for the option (printable)
boolean
Whether this option is selected
array
Extra data about the radio
array
Parsing options
string
_getSelectGroupHtml(\$label $label, \$optionHtml $optionHtml) : string
\$label
Label for the group
\$optionHtml
HTML for the options within the group
string
_getSelectInput(string $name, string $value, array $choices, array $controlOptions, string $id) : string
string
Name of the select input. If multiple selections are allow, [] will be appended.
string
Default selected option
array
Choices for the select
array
Control options
string
Optional ID for the input. If not specified, one will be generated.
string
_getSelectOptionHtml(string $value, string $label, boolean $selected, array $extra) : string
string
Value for the option (what it submitted to the server)
string
Label for the option (printable)
boolean
Whether this option is selected
array
Extra data about the option
string
_getSpinBoxInput(string $name, string $value, array $controlOptions, string $id) : string
string
Name of the input
string
Default selected option
array
Control options
string
Optional ID for the input. If not specified, one will be generated.
string
_getTextInput(string $type, string $name, string $value, array $controlOptions, string $id) : string
Standard text inputs may span multiple rows, turning into a textarea.
string
Type of input requested; either text or password
string
Name of the input field. Already HTML escaped.
string
Default value for the input field. Already HTML escaped.
array
Array of options for the control
string
Optional ID for the input. If not specified, one will be generated.
string
_getUploadInput(string $name, string $value, array $controlOptions, string $id) : string
string
Name of the input
string
Default selected option
array
Control options
string
Optional ID for the input. If not specified, one will be generated.
string
_processControlChoices(array $choices, string | array $selectedValue, array $callbacks, array $options) : string
array
Array of choices
string
array
Selected value
array
Callbacks. Define 2 keys: group and option
array
Extra options to manipulate the choices.
string
_wrapControlUnit(string $label, string $controlText, string $id, array $rowOptions) : string
string
Row label
string
Text of the control
string
Unique ID for the control
array
Standard row options: * hint - hint text shown under leabel * class - class to apply to whole unit * explain - text to show under control * labelHidden - boolean, if true label is not shown * html - arbitrary html to add between control and explain text
string
Control wrapped in label/row markup__construct()
Don't instantiate this object. Use it statically.
$_controlCounter : integer
$_controlIdLog
$_listItemGroupCounter : integer
$_oneUseId : null | string
Useful for generating it in one function and defering to another (possibly recursive function) to use it.
Null means it has not been set.