Fix missing commit() flag in postgres savepoint class
[mediawiki.git] / includes / htmlform / fields / HTMLSelectNamespace.php
blob230790dbeb10bd04bf82f72b0ad3e379d1156446
1 <?php
2 /**
3 * Wrapper for Html::namespaceSelector to use in HTMLForm
4 */
5 class HTMLSelectNamespace extends HTMLFormField {
6 public function __construct( $params ) {
7 parent::__construct( $params );
9 $this->mAllValue = array_key_exists( 'all', $params )
10 ? $params['all']
11 : 'all';
15 function getInputHTML( $value ) {
16 return Html::namespaceSelector(
18 'selected' => $value,
19 'all' => $this->mAllValue
20 ], [
21 'name' => $this->mName,
22 'id' => $this->mID,
23 'class' => 'namespaceselector',
28 public function getInputOOUI( $value ) {
29 return new MediaWiki\Widget\NamespaceInputWidget( [
30 'value' => $value,
31 'name' => $this->mName,
32 'id' => $this->mID,
33 'includeAllValue' => $this->mAllValue,
34 ] );
37 protected function getOOUIModules() {
38 // FIXME: NamespaceInputWidget should be in its own module (probably?)
39 return [ 'mediawiki.widgets' ];
42 protected function shouldInfuseOOUI() {
43 return true;