Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
NamespacesMultiselectWidget | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
getJavaScriptClassName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getConfig | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Widget; |
4 | |
5 | /** |
6 | * Widget to select multiple namespaces. |
7 | * |
8 | * @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt |
9 | * @license MIT |
10 | */ |
11 | class NamespacesMultiselectWidget extends TagMultiselectWidget { |
12 | |
13 | protected $allowEditTags = null; |
14 | |
15 | /** |
16 | * @param array $config Configuration options |
17 | * - bool $config['allowEditTags'] Allow editing of the tags by clicking them |
18 | */ |
19 | public function __construct( array $config = [] ) { |
20 | parent::__construct( $config ); |
21 | |
22 | if ( isset( $config['allowEditTags'] ) ) { |
23 | $this->allowEditTags = $config['allowEditTags']; |
24 | } |
25 | |
26 | $this->addClasses( [ 'mw-widgets-namespacesMultiselectWidget' ] ); |
27 | } |
28 | |
29 | protected function getJavaScriptClassName() { |
30 | return 'mw.widgets.NamespacesMultiselectWidget'; |
31 | } |
32 | |
33 | public function getConfig( &$config ) { |
34 | if ( $this->allowEditTags !== null ) { |
35 | $config['allowEditTags'] = $this->allowEditTags; |
36 | } |
37 | |
38 | return parent::getConfig( $config ); |
39 | } |
40 | |
41 | } |