Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
PagelistInputWidget | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
getJavaScriptClassName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getConfig | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace ProofreadPage\OOUI; |
4 | |
5 | use OOUI\MultilineTextInputWidget; |
6 | |
7 | /** |
8 | * @license GPL-2.0-or-later |
9 | * |
10 | * A custom widget to help in inpu of Pagelists |
11 | */ |
12 | class PagelistInputWidget extends \OOUI\Widget { |
13 | |
14 | /** |
15 | * @var string |
16 | */ |
17 | protected $templateParameter; |
18 | /** |
19 | * @var MultilineTextInputWidget |
20 | */ |
21 | protected $textInputWidget; |
22 | |
23 | /** |
24 | * @inheritDoc |
25 | */ |
26 | public function __construct( array $config = [] ) { |
27 | parent::__construct( array_merge( [ |
28 | 'infusable' => true |
29 | ], $config ) ); |
30 | |
31 | $this->templateParameter = $config['templateParameter']; |
32 | |
33 | $this->textInputWidget = new MultilineTextInputWidget( $config ); |
34 | $this->textInputWidget->addClasses( [ 'prp-pagelist-input-textarea' ] ); |
35 | $this->appendContent( $this->textInputWidget ); |
36 | |
37 | $this->addClasses( [ 'prp-pagelistInputWidget' ] ); |
38 | } |
39 | |
40 | /** |
41 | * @inheritDoc |
42 | */ |
43 | protected function getJavaScriptClassName() { |
44 | return 'mw.proofreadpage.PagelistInputWidget'; |
45 | } |
46 | |
47 | /** |
48 | * @inheritDoc |
49 | */ |
50 | public function getConfig( &$config ) { |
51 | $config['templateParameter'] = $this->templateParameter; |
52 | $config['textInputWidget'] = $this->textInputWidget; |
53 | return parent::getConfig( $config ); |
54 | } |
55 | } |