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 | /** @var bool|null */ |
14 | protected $allowEditTags = null; |
15 | |
16 | /** |
17 | * @param array $config Configuration options |
18 | * - bool $config['allowEditTags'] Allow editing of the tags by clicking them |
19 | */ |
20 | public function __construct( array $config = [] ) { |
21 | parent::__construct( $config ); |
22 | |
23 | if ( isset( $config['allowEditTags'] ) ) { |
24 | $this->allowEditTags = $config['allowEditTags']; |
25 | } |
26 | |
27 | $this->addClasses( [ 'mw-widgets-namespacesMultiselectWidget' ] ); |
28 | } |
29 | |
30 | protected function getJavaScriptClassName() { |
31 | return 'mw.widgets.NamespacesMultiselectWidget'; |
32 | } |
33 | |
34 | public function getConfig( &$config ) { |
35 | if ( $this->allowEditTags !== null ) { |
36 | $config['allowEditTags'] = $this->allowEditTags; |
37 | } |
38 | |
39 | return parent::getConfig( $config ); |
40 | } |
41 | |
42 | } |