Added a separate error message for mkdir failures
[lhc/web/wiklou.git] / includes / htmlform / HTMLSelectNamespace.php
index dfab6cf..597c27a 100644 (file)
@@ -5,7 +5,11 @@
 class HTMLSelectNamespace extends HTMLFormField {
        public function __construct( $params ) {
                parent::__construct( $params );
-               $this->mAllValue = isset( $this->mParams['all'] ) ? $this->mParams['all'] : 'all';
+
+               $this->mAllValue = array_key_exists( 'all', $params )
+                       ? $params['all']
+                       : 'all';
+
        }
 
        function getInputHTML( $value ) {
@@ -22,21 +26,11 @@ class HTMLSelectNamespace extends HTMLFormField {
        }
 
        public function getInputOOUI( $value ) {
-               $namespaceOptions = Html::namespaceSelectorOptions( array( 'all' => $this->mAllValue ) );
-
-               $options = array();
-               foreach( $namespaceOptions as $id => $name ) {
-                       $options[] = array(
-                               'data' => (string)$id,
-                               'label' => $name,
-                       );
-               };
-
-               return new OOUI\DropdownInputWidget( array(
-                       'options' => $options,
+               return new MediaWiki\Widget\NamespaceInputWidget( array(
                        'value' => $value,
                        'name' => $this->mName,
                        'id' => $this->mID,
+                       'includeAllValue' => $this->mAllValue,
                ) );
        }
 }