MediaWiki  REL1_22
HTMLCheckMatrix Class Reference

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...

Inheritance diagram for HTMLCheckMatrix:
Collaboration diagram for HTMLCheckMatrix:

List of all members.

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

Detailed Description

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:

  • columns
    • Required list of columns in the matrix.
  • rows
    • Required list of rows in the matrix.
  • force-options-on
    • Accepts array of column-row tags to be displayed as enabled but unavailable to change
  • force-options-off
    • Accepts array of column-row tags to be displayed as disabled but unavailable to change.
  • tooltips
    • Optional array mapping row label to tooltip content
  • tooltip-class
    • Optional CSS class used on tooltip container span. Defaults to mw-icon-question.

Definition at line 2024 of file HTMLForm.php.


Constructor & Destructor Documentation

Initialise the object.

Parameters:
array$paramsAssociative Array. See HTMLForm doc for syntax.
Since:
1.22 The 'label' attribute no longer accepts raw HTML, use 'label-raw' instead
Exceptions:
MWException

Reimplemented from HTMLFormField.

Definition at line 2033 of file HTMLForm.php.


Member Function Documentation

Support for seperating multi-option preferences into multiple preferences Due to lack of array support.

Parameters:
$dataarray

Implements HTMLNestedFilterable.

Definition at line 2221 of file HTMLForm.php.

Reimplemented from HTMLFormField.

Definition at line 2213 of file HTMLForm.php.

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.

Parameters:
array$valueof the options that should be checked
Returns:
String

Reimplemented from HTMLFormField.

Definition at line 2080 of file HTMLForm.php.

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".

Parameters:
string$valuethe value to set the input to
Returns:
String complete HTML table row

Reimplemented from HTMLFormField.

Definition at line 2165 of file HTMLForm.php.

HTMLCheckMatrix::isTagForcedOff ( tag) [protected]

Definition at line 2146 of file HTMLForm.php.

HTMLCheckMatrix::isTagForcedOn ( tag) [protected]

Definition at line 2151 of file HTMLForm.php.

Parameters:
$requestWebRequest
Returns:
Array

Reimplemented from HTMLFormField.

Definition at line 2193 of file HTMLForm.php.

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

Parameters:
string$valuethe value the field was submitted with
array$alldatathe data collected from the form
Returns:
Mixed Bool true on success, or String error to display.

Reimplemented from HTMLFormField.

Definition at line 2041 of file HTMLForm.php.


Member Data Documentation

HTMLCheckMatrix::$requiredParams [static, private]
Initial value:
 array(
        
        'fieldname',
        
        'rows', 'columns'
    )

Definition at line 2026 of file HTMLForm.php.


The documentation for this class was generated from the following file: