|
MediaWiki
REL1_23
|
A checkbox matrix Operates similarly to HTMLMultiSelectField, but instead of using an array of options, uses an array of rows and an array of columns to dynamically construct a matrix of options. More...


Public Member Functions | |
| __construct ($params) | |
| Initialise the object. | |
| filterDataForSubmit ($data) | |
| Support for seperating multi-option preferences into multiple preferences Due to lack of array support. | |
| getDefault () | |
| getInputHTML ($value) | |
| Build a table containing a matrix of checkbox options. | |
| getTableRow ($value) | |
| Get the complete table row for the input, including help text, labels, and whatever. | |
| loadDataFromRequest ($request) | |
| validate ($value, $alldata) | |
| Override this function to add specific validation checks on the field input. | |
Protected Member Functions | |
| isTagForcedOff ($tag) | |
| isTagForcedOn ($tag) | |
Static Private Attributes | |
| static | $requiredParams |
A checkbox matrix Operates similarly to HTMLMultiSelectField, but instead of using an array of options, uses an array of rows and an array of columns to dynamically construct a matrix of options.
The tags used to identify a particular cell are of the form "columnName-rowName"
Options:
Definition at line 24 of file HTMLCheckMatrix.php.
| HTMLCheckMatrix::__construct | ( | $ | params | ) |
Initialise the object.
| array | $params | Associative Array. See HTMLForm doc for syntax. |
| MWException |
Reimplemented from HTMLFormField.
Definition at line 33 of file HTMLCheckMatrix.php.
References $params.
| HTMLCheckMatrix::filterDataForSubmit | ( | $ | data | ) |
Support for seperating multi-option preferences into multiple preferences Due to lack of array support.
| $data | array |
Implements HTMLNestedFilterable.
Definition at line 222 of file HTMLCheckMatrix.php.
References $columns, $res, array(), as, HTMLFormField\flattenOptions(), isTagForcedOff(), and isTagForcedOn().
Reimplemented from HTMLFormField.
Definition at line 214 of file HTMLCheckMatrix.php.
References array().
Referenced by loadDataFromRequest().
| HTMLCheckMatrix::getInputHTML | ( | $ | value | ) |
Build a table containing a matrix of checkbox options.
The value of each option is a combination of the row tag and column tag. mParams['rows'] is an array with row labels as keys and row tags as values. mParams['columns'] is an array with column labels as keys and column tags as values.
| array | $value | of the options that should be checked |
Reimplemented from HTMLFormField.
Definition at line 82 of file HTMLCheckMatrix.php.
References $attribs, $columns, $html, $value, array(), as, Xml\check(), Html\element(), HTMLFormField\getAttributes(), isTagForcedOff(), isTagForcedOn(), and Html\rawElement().
Referenced by getTableRow().
| HTMLCheckMatrix::getTableRow | ( | $ | value | ) |
Get the complete table row for the input, including help text, labels, and whatever.
We override this function since the label should always be on a separate line above the options in the case of a checkbox matrix, i.e. it's always a "vertical-label".
| string | $value | the value to set the input to |
Reimplemented from HTMLFormField.
Definition at line 166 of file HTMLCheckMatrix.php.
References $html, $value, array(), HTMLFormField\getErrorsAndErrorClass(), HTMLFormField\getHelpText(), HTMLFormField\getHelpTextHtmlTable(), getInputHTML(), HTMLFormField\getLabelHtml(), list, and Html\rawElement().
| HTMLCheckMatrix::isTagForcedOff | ( | $ | tag | ) | [protected] |
Definition at line 145 of file HTMLCheckMatrix.php.
Referenced by filterDataForSubmit(), and getInputHTML().
| HTMLCheckMatrix::isTagForcedOn | ( | $ | tag | ) | [protected] |
Definition at line 150 of file HTMLCheckMatrix.php.
Referenced by filterDataForSubmit(), and getInputHTML().
| HTMLCheckMatrix::loadDataFromRequest | ( | $ | request | ) |
| $request | WebRequest |
Reimplemented from HTMLFormField.
Definition at line 194 of file HTMLCheckMatrix.php.
References array(), and getDefault().
| HTMLCheckMatrix::validate | ( | $ | value, |
| $ | alldata | ||
| ) |
Override this function to add specific validation checks on the field input.
Don't forget to call parent::validate() to ensure that the user-defined callback mValidationCallback is still run
| string | $value | The value the field was submitted with |
| array | $alldata | The data collected from the form |
Reimplemented from HTMLFormField.
Definition at line 41 of file HTMLCheckMatrix.php.
References $columns, $value, array(), as, and HTMLFormField\msg().
HTMLCheckMatrix::$requiredParams [static, private] |
array( 'fieldname', 'rows', 'columns' )
Definition at line 25 of file HTMLCheckMatrix.php.