43 $rows = $this->mParams[
'rows'];
44 $columns = $this->mParams[
'columns'];
47 $p = parent::validate(
$value, $alldata );
60 foreach (
$rows as $rowTag ) {
61 foreach ( $columns as $columnTag ) {
62 $validOptions[] = $columnTag .
'-' .
$rowTag;
66 if ( count( $validValues ) == count(
$value ) ) {
69 return $this->
msg(
'htmlform-select-badoption' );
86 $rows = $this->mParams[
'rows'];
87 $columns = $this->mParams[
'columns'];
92 $headerContents = Html::rawElement(
'td', [],
"\u{00A0}" );
93 foreach ( $columns as $columnLabel => $columnTag ) {
94 $headerContents .= Html::rawElement(
'th', [], $columnLabel );
96 $thead = Html::rawElement(
'tr', [],
"\n$headerContents\n" );
97 $tableContents .= Html::rawElement(
'thead', [],
"\n$thead\n" );
99 $tooltipClass =
'mw-icon-question';
100 if (
isset( $this->mParams[
'tooltip-class'] ) ) {
101 $tooltipClass = $this->mParams[
'tooltip-class'];
105 foreach (
$rows as $rowLabel => $rowTag ) {
107 if (
isset( $this->mParams[
'tooltips'][$rowLabel] ) ) {
109 'class' =>
"mw-htmlform-tooltip $tooltipClass",
110 'title' => $this->mParams[
'tooltips'][
$rowLabel],
111 'aria-label' => $this->mParams[
'tooltips'][
$rowLabel]
113 $rowLabel .=
' ' . Html::element(
'span', $tooltipAttribs,
'' );
115 $rowContents = Html::rawElement(
'td', [], $rowLabel );
116 foreach ( $columns as $columnTag ) {
117 $thisTag =
"$columnTag-$rowTag";
120 'id' =>
"{$this->mID}-$thisTag",
126 $thisAttribs[
'disabled'] = 1;
127 $thisAttribs[
'class'] =
'checkmatrix-forced checkmatrix-forced-off';
130 $thisAttribs[
'disabled'] = 1;
131 $thisAttribs[
'class'] =
'checkmatrix-forced checkmatrix-forced-on';
136 $rowContents .= Html::rawElement(
142 $tableContents .= Html::rawElement(
'tr', [],
"\n$rowContents\n" );
146 $html .= Html::rawElement(
'table',
147 [
'class' =>
'mw-htmlform-matrix' ],
148 Html::rawElement(
'tbody', [],
"\n$tableContents\n" ) ) .
"\n";
158 'name' => $this->mName,
161 'rows' => $this->mParams[
'rows'],
162 'columns' => $this->mParams[
'columns'],
163 'tooltips' => $this->mParams[
'tooltips'] ?? [],
164 'forcedOff' => $this->mParams[
'force-options-off'] ?? [],
165 'forcedOn' => $this->mParams[
'force-options-on'] ?? [],
167 ] + OOUI\Element::configFromHtmlAttributes(
$attribs )
172 $checkbox = Xml::check(
"{$this->mName}[]", $checked,
$attribs );
173 if ( $this->mParent->getConfig()->get(
'UseMediaWikiUIEverywhere' ) ) {
174 $checkbox = Html::openElement(
'div', [
'class' =>
'mw-ui-checkbox' ] ) .
176 Html::element(
'label', [
'for' =>
$attribs[
'id'] ] ) .
177 Html::closeElement(
'div' );
183 return isset( $this->mParams[
'force-options-off'] )
184 &&
in_array( $tag, $this->mParams[
'force-options-off'] );
188 return isset( $this->mParams[
'force-options-on'] )
189 &&
in_array( $tag, $this->mParams[
'force-options-on'] );
206 $fieldType = static::class;
208 $cellAttributes = [
'colspan' => 2 ];
211 $hideAttributes = [];
212 if ( $this->mHideIf ) {
213 $hideAttributes[
'data-hide-if'] = FormatJson::encode( $this->mHideIf );
214 $hideClass =
'mw-htmlform-hide-if';
219 $field = Html::rawElement(
221 [
'class' =>
'mw-input' ] + $cellAttributes,
222 $inputHtml .
"\n$errors"
225 $html = Html::rawElement(
'tr',
226 [
'class' =>
"mw-htmlform-vertical-label $hideClass" ] + $hideAttributes,
228 $html .= Html::rawElement(
'tr',
229 [
'class' =>
"mw-htmlform-field-$fieldType {$this->mClass} $errorClass $hideClass" ] +
245 return $request->getArray( $this->mName, [] );
253 return $this->mDefault ?? [];
260 foreach ( $columns as $column ) {
261 foreach (
$rows as $row ) {
263 $thisTag =
"$column-$row";
278 return [
'mediawiki.widgets.CheckMatrixWidget' ];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
A checkbox matrix Operates similarly to HTMLMultiSelectField, but instead of using an array of option...
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.
getOneCheckboxHTML( $checked, $attribs)
shouldInfuseOOUI()
Whether the field should be automatically infused.
__construct( $params)
Initialise the object.
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.
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
loadDataFromRequest( $request)
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
filterDataForSubmit( $data)
Support for separating multi-option preferences into multiple preferences Due to lack of array suppor...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))