Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
HTMLLargeMultiSelectField | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 1 |
getInputHTML | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
30 |
1 | <?php |
2 | |
3 | use MediaWiki\Html\Html; |
4 | |
5 | class HTMLLargeMultiSelectField extends HTMLMultiSelectField { |
6 | public function getInputHTML( $value ) { |
7 | if ( !is_array( $value ) ) { |
8 | $value = [ $value ]; |
9 | } |
10 | |
11 | $options = "\n"; |
12 | foreach ( $this->mParams[ 'options' ] as $name => $optvalue ) { |
13 | $options .= Xml::option( |
14 | (string)$name, |
15 | $optvalue, |
16 | in_array( $optvalue, $value ) |
17 | ) . "\n"; |
18 | } |
19 | |
20 | $properties = [ |
21 | 'multiple' => 'multiple', |
22 | 'id' => $this->mID, |
23 | 'name' => "$this->mName[]", |
24 | ]; |
25 | |
26 | if ( !empty( $this->mParams[ 'disabled' ] ) ) { |
27 | $properties[ 'disabled' ] = 'disabled'; |
28 | } |
29 | |
30 | if ( !empty( $this->mParams[ 'cssclass' ] ) ) { |
31 | $properties[ 'class' ] = $this->mParams[ 'cssclass' ]; |
32 | } |
33 | |
34 | return Html::rawElement( 'select', $properties, $options ); |
35 | } |
36 | } |