MediaWiki  master
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 ) {
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 }
HTMLSelectNamespace\$mAllValue
string null $mAllValue
Definition: HTMLSelectNamespace.php:10
HTMLSelectNamespace\__construct
__construct( $params)
Stable to call Initialise the object.Stable to call Associative Array. See HTMLForm doc for syntax....
Definition: HTMLSelectNamespace.php:16
HTMLSelectNamespace\getInputHTML
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....
Definition: HTMLSelectNamespace.php:28
HTMLSelectNamespace
Wrapper for Html::namespaceSelector to use in HTMLForm.
Definition: HTMLSelectNamespace.php:7
HTMLFormField
The parent class to generate form fields.
Definition: HTMLFormField.php:9
HTMLSelectNamespace\getOOUIModules
getOOUIModules()
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to...
Definition: HTMLSelectNamespace.php:58
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.Defaults to false, which getOOUI will interpret as "...
Definition: HTMLSelectNamespace.php:45
HTMLSelectNamespace\shouldInfuseOOUI
shouldInfuseOOUI()
Whether the field should be automatically infused.Note that all OOUI HTMLForm fields are infusable (y...
Definition: HTMLSelectNamespace.php:67