MediaWiki  master
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 ) {
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 }
HTMLSelectNamespace\$mAllValue
string null $mAllValue
Definition: HTMLSelectNamespace.php:8
HTMLSelectNamespace\__construct
__construct( $params)
Initialise the object.
Definition: HTMLSelectNamespace.php:10
HTMLSelectNamespace\getInputHTML
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
Definition: HTMLSelectNamespace.php:18
HTMLSelectNamespace
Wrapper for Html::namespaceSelector to use in HTMLForm.
Definition: HTMLSelectNamespace.php:5
HTMLFormField
The parent class to generate form fields.
Definition: HTMLFormField.php:7
HTMLSelectNamespace\getOOUIModules
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
Definition: HTMLSelectNamespace.php:40
MediaWiki\Widget\NamespaceInputWidget
Namespace input widget.
Definition: NamespaceInputWidget.php:11
Html\namespaceSelector
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
Definition: Html.php:894
HTMLSelectNamespace\getInputOOUI
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
Definition: HTMLSelectNamespace.php:31
HTMLSelectNamespace\shouldInfuseOOUI
shouldInfuseOOUI()
Whether the field should be automatically infused.
Definition: HTMLSelectNamespace.php:45