Merge "Rewrite pref cleanup script"
[lhc/web/wiklou.git] / includes / widget / ComplexTitleInputWidget.php
index ea0ef9e..ca6c848 100644 (file)
@@ -1,14 +1,12 @@
 <?php
-/**
- * MediaWiki Widgets – ComplexTitleInputWidget class.
- *
- * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
- */
+
 namespace MediaWiki\Widget;
 
 /**
  * Complex title input widget.
+ *
+ * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
+ * @license MIT
  */
 class ComplexTitleInputWidget extends \OOUI\Widget {
 
@@ -19,21 +17,20 @@ class ComplexTitleInputWidget extends \OOUI\Widget {
         * Like TitleInputWidget, but the namespace has to be input through a separate dropdown field.
         *
         * @param array $config Configuration options
-        * @param array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
-        *  with list of namespaces
-        * @param array $config['title'] Configuration for the TitleInputWidget text field
+        *   - array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
+        *     with list of namespaces
+        *   - array $config['title'] Configuration for the TitleInputWidget text field
         */
-       public function __construct( array $config = array() ) {
+       public function __construct( array $config = [] ) {
                // Configuration initialization
                $config = array_merge(
-                       array(
-                               'namespace' => array(),
-                               'title' => array(),
-                       ),
+                       [
+                               'namespace' => [],
+                               'title' => [],
+                       ],
                        $config
                );
 
-               // Parent constructor
                parent::__construct( $config );
 
                // Properties
@@ -41,20 +38,17 @@ class ComplexTitleInputWidget extends \OOUI\Widget {
                $this->namespace = new NamespaceInputWidget( $config['namespace'] );
                $this->title = new TitleInputWidget( array_merge(
                        $config['title'],
-                       array(
-                               // The inner TitleInputWidget shouldn't be infusable,
-                               // only the ComplexTitleInputWidget itself can be.
-                               'infusable' => false,
+                       [
                                'relative' => true,
                                'namespace' => isset( $config['namespace']['value'] ) ?
                                        $config['namespace']['value'] :
                                        null,
-                       )
+                       ]
                ) );
 
                // Initialization
                $this
-                       ->addClasses( array( 'mw-widget-complexTitleInputWidget' ) )
+                       ->addClasses( [ 'mw-widget-complexTitleInputWidget' ] )
                        ->appendContent( $this->namespace, $this->title );
        }
 
@@ -64,7 +58,9 @@ class ComplexTitleInputWidget extends \OOUI\Widget {
 
        public function getConfig( &$config ) {
                $config['namespace'] = $this->config['namespace'];
+               $config['namespace']['dropdown']['$overlay'] = true;
                $config['title'] = $this->config['title'];
+               $config['title']['$overlay'] = true;
                return parent::getConfig( $config );
        }
 }