Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / htmlform / HTMLSelectNamespace.php
index b2ec9ca..4efdfbf 100644 (file)
@@ -3,13 +3,16 @@
  * Wrapper for Html::namespaceSelector to use in HTMLForm
  */
 class HTMLSelectNamespace extends HTMLFormField {
-       function getInputHTML( $value ) {
-               $allValue = ( isset( $this->mParams['all'] ) ? $this->mParams['all'] : 'all' );
+       public function __construct( $params ) {
+               parent::__construct( $params );
+               $this->mAllValue = isset( $this->mParams['all'] ) ? $this->mParams['all'] : 'all';
+       }
 
+       function getInputHTML( $value ) {
                return Html::namespaceSelector(
                        array(
                                'selected' => $value,
-                               'all' => $allValue
+                               'all' => $this->mAllValue
                        ), array(
                                'name' => $this->mName,
                                'id' => $this->mID,
@@ -17,4 +20,13 @@ class HTMLSelectNamespace extends HTMLFormField {
                        )
                );
        }
+
+       public function getInputOOUI( $value ) {
+               return new MediaWiki\Widget\NamespaceInputWidget( array(
+                       'value' => $value,
+                       'name' => $this->mName,
+                       'id' => $this->mID,
+                       'includeAllValue' => $this->mAllValue,
+               ) );
+       }
 }