MediaWiki REL1_32
HTMLSelectNamespace.php
Go to the documentation of this file.
1<?php
6
8 protected $mAllValue;
9
10 public function __construct( $params ) {
11 parent::__construct( $params );
12
13 $this->mAllValue = array_key_exists( 'all', $params )
14 ? $params['all']
15 : 'all';
16 }
17
18 public function getInputHTML( $value ) {
19 return Html::namespaceSelector(
20 [
21 'selected' => $value,
22 'all' => $this->mAllValue
23 ], [
24 'name' => $this->mName,
25 'id' => $this->mID,
26 'class' => 'namespaceselector',
27 ]
28 );
29 }
30
31 public function getInputOOUI( $value ) {
33 'value' => $value,
34 'name' => $this->mName,
35 'id' => $this->mID,
36 'includeAllValue' => $this->mAllValue,
37 ] );
38 }
39
40 protected function getOOUIModules() {
41 // FIXME: NamespaceInputWidget should be in its own module (probably?)
42 return [ 'mediawiki.widgets' ];
43 }
44
45 protected function shouldInfuseOOUI() {
46 return true;
47 }
48}
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