MediaWiki REL1_40
HTMLSelectNamespace.php
Go to the documentation of this file.
1<?php
2
4
11
13 protected $mAllValue;
15 protected $mUserLang;
16
21 public function __construct( $params ) {
22 parent::__construct( $params );
23
24 $this->mAllValue = array_key_exists( 'all', $params )
25 ? $params['all']
26 : 'all';
27 $this->mUserLang = array_key_exists( 'in-user-lang', $params )
28 ? $params['in-user-lang']
29 : false;
30 }
31
36 public function getInputHTML( $value ) {
37 return Html::namespaceSelector(
38 [
39 'selected' => $value,
40 'all' => $this->mAllValue,
41 'in-user-lang' => $this->mUserLang,
42 ], [
43 'name' => $this->mName,
44 'id' => $this->mID,
45 'class' => 'namespaceselector',
46 ]
47 );
48 }
49
54 public function getInputOOUI( $value ) {
56 'value' => $value,
57 'name' => $this->mName,
58 'id' => $this->mID,
59 'includeAllValue' => $this->mAllValue,
60 'userLang' => $this->mUserLang,
61 ] );
62 }
63
68 protected function getOOUIModules() {
69 // FIXME: NamespaceInputWidget should be in its own module (probably?)
70 return [ 'mediawiki.widgets' ];
71 }
72
77 protected function shouldInfuseOOUI() {
78 return true;
79 }
80}
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....
This class is a collection of static functions that serve two purposes:
Definition Html.php:55