MediaWiki REL1_31
HTMLSelectNamespace.php
Go to the documentation of this file.
1<?php
6 public function __construct( $params ) {
7 parent::__construct( $params );
8
9 $this->mAllValue = array_key_exists( 'all', $params )
10 ? $params['all']
11 : 'all';
12 }
13
14 public function getInputHTML( $value ) {
15 return Html::namespaceSelector(
16 [
17 'selected' => $value,
18 'all' => $this->mAllValue
19 ], [
20 'name' => $this->mName,
21 'id' => $this->mID,
22 'class' => 'namespaceselector',
23 ]
24 );
25 }
26
27 public function getInputOOUI( $value ) {
29 'value' => $value,
30 'name' => $this->mName,
31 'id' => $this->mID,
32 'includeAllValue' => $this->mAllValue,
33 ] );
34 }
35
36 protected function getOOUIModules() {
37 // FIXME: NamespaceInputWidget should be in its own module (probably?)
38 return [ 'mediawiki.widgets' ];
39 }
40
41 protected function shouldInfuseOOUI() {
42 return true;
43 }
44}
The parent class to generate form fields.
Wrapper for Html::namespaceSelector to use in HTMLForm.
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
shouldInfuseOOUI()
Whether the field should be automatically infused.
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
__construct( $params)
Initialise the object.
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
$params