MediaWiki REL1_35
HTMLSelectNamespace.php
Go to the documentation of this file.
1<?php
8
10 protected $mAllValue;
11
12 /*
13 * @stable to call
14 */
15 public function __construct( $params ) {
16 parent::__construct( $params );
17
18 $this->mAllValue = array_key_exists( 'all', $params )
19 ? $params['all']
20 : 'all';
21 }
22
27 public function getInputHTML( $value ) {
28 return Html::namespaceSelector(
29 [
30 'selected' => $value,
31 'all' => $this->mAllValue
32 ], [
33 'name' => $this->mName,
34 'id' => $this->mID,
35 'class' => 'namespaceselector',
36 ]
37 );
38 }
39
44 public function getInputOOUI( $value ) {
46 'value' => $value,
47 'name' => $this->mName,
48 'id' => $this->mID,
49 'includeAllValue' => $this->mAllValue,
50 ] );
51 }
52
57 protected function getOOUIModules() {
58 // FIXME: NamespaceInputWidget should be in its own module (probably?)
59 return [ 'mediawiki.widgets' ];
60 }
61
66 protected function shouldInfuseOOUI() {
67 return true;
68 }
69}
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.Defaults to false, which getOOUI will interpret as "...
shouldInfuseOOUI()
Whether the field should be automatically infused.Note that all OOUI HTMLForm fields are infusable (y...
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....