MediaWiki REL1_37
HTMLSelectNamespace.php
Go to the documentation of this file.
1<?php
8
10 protected $mAllValue;
11
16 public function __construct( $params ) {
17 parent::__construct( $params );
18
19 $this->mAllValue = array_key_exists( 'all', $params )
20 ? $params['all']
21 : 'all';
22 }
23
28 public function getInputHTML( $value ) {
29 return Html::namespaceSelector(
30 [
31 'selected' => $value,
32 'all' => $this->mAllValue
33 ], [
34 'name' => $this->mName,
35 'id' => $this->mID,
36 'class' => 'namespaceselector',
37 ]
38 );
39 }
40
45 public function getInputOOUI( $value ) {
47 'value' => $value,
48 'name' => $this->mName,
49 'id' => $this->mID,
50 'includeAllValue' => $this->mAllValue,
51 ] );
52 }
53
58 protected function getOOUIModules() {
59 // FIXME: NamespaceInputWidget should be in its own module (probably?)
60 return [ 'mediawiki.widgets' ];
61 }
62
67 protected function shouldInfuseOOUI() {
68 return true;
69 }
70}
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...
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....