Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
InputFormPage | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
getHtml | |
0.00% |
0 / 30 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace FileImporter\Html; |
4 | |
5 | use MediaWiki\EditPage\EditPage; |
6 | use MediaWiki\Html\Html; |
7 | use OOUI\ButtonInputWidget; |
8 | use OOUI\TextInputWidget; |
9 | |
10 | /** |
11 | * Page displaying a form for entering a URL to start an import. |
12 | * |
13 | * @license GPL-2.0-or-later |
14 | * @author Addshore |
15 | */ |
16 | class InputFormPage extends SpecialPageHtmlFragment { |
17 | |
18 | /** |
19 | * @return string |
20 | */ |
21 | public function getHtml() { |
22 | return Html::openElement( 'div' ) . |
23 | Html::openElement( |
24 | 'form', |
25 | [ |
26 | 'action' => $this->getPageTitle()->getLocalURL(), |
27 | 'method' => 'POST', |
28 | ] |
29 | ) . |
30 | Html::hidden( 'wpUnicodeCheck', EditPage::UNICODE_CHECK ) . |
31 | ( new HelpBanner( $this ) )->getHtml() . |
32 | new TextInputWidget( |
33 | [ |
34 | 'name' => 'clientUrl', |
35 | 'autofocus' => true, |
36 | 'required' => true, |
37 | 'type' => 'url', |
38 | 'placeholder' => $this->msg( 'fileimporter-exampleprefix' )->plain() . |
39 | ': https://en.wikipedia.org/wiki/File:Berlin_Skyline', |
40 | ] |
41 | ) . |
42 | new ButtonInputWidget( |
43 | [ |
44 | 'classes' => [ 'mw-fileimporter-url-submit' ], |
45 | 'label' => $this->msg( 'fileimporter-submit' )->plain(), |
46 | 'type' => 'submit', |
47 | 'flags' => [ 'primary', 'progressive' ], |
48 | ] |
49 | ) . |
50 | Html::closeElement( 'form' ) . |
51 | Html::closeElement( 'div' ); |
52 | } |
53 | |
54 | } |