Add CollationFa
[lhc/web/wiklou.git] / includes / htmlform / HTMLSelectNamespace.php
index b2ec9ca..ef21969 100644 (file)
@@ -3,18 +3,34 @@
  * 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 = array_key_exists( 'all', $params )
+                       ? $params['all']
+                       : 'all';
+
+       }
 
+       function getInputHTML( $value ) {
                return Html::namespaceSelector(
-                       array(
+                       [
                                'selected' => $value,
-                               'all' => $allValue
-                       ), array(
+                               'all' => $this->mAllValue
+                       ], [
                                'name' => $this->mName,
                                'id' => $this->mID,
                                'class' => 'namespaceselector',
-                       )
+                       ]
                );
        }
+
+       public function getInputOOUI( $value ) {
+               return new MediaWiki\Widget\NamespaceInputWidget( [
+                       'value' => $value,
+                       'name' => $this->mName,
+                       'id' => $this->mID,
+                       'includeAllValue' => $this->mAllValue,
+               ] );
+       }
 }