Merge "Override MediaHandlers in tests using MediaWikiServices"
[lhc/web/wiklou.git] / includes / widget / SearchInputWidget.php
index 5ff411d..0d71629 100644 (file)
@@ -16,6 +16,7 @@ class SearchInputWidget extends TitleInputWidget {
        protected $performSearchOnClick = true;
        protected $validateTitle = false;
        protected $highlightFirst = false;
+       protected $dataLocation = 'header';
 
        /**
         * @param array $config Configuration options
@@ -24,14 +25,14 @@ class SearchInputWidget extends TitleInputWidget {
         * @param boolean|null $config['performSearchOnClick'] If true, the script will start a search
         *  whenever a user hits a suggestion. If false, the text of the suggestion is inserted into the
         *  text field only (default: true)
+        * @param string $config['dataLocation'] Where the search input field will be
+        *  used (header or content, default: header)
         */
        public function __construct( array $config = [] ) {
                $config = array_merge( [
-                       'infusable' => true,
                        'maxLength' => null,
                        'type' => 'search',
                        'icon' => 'search',
-                       'dataLocation' => 'content',
                ], $config );
 
                // Parent constructor
@@ -46,7 +47,7 @@ class SearchInputWidget extends TitleInputWidget {
                        $this->performSearchOnClick = $config['performSearchOnClick'];
                }
 
-               if ( $config['dataLocation'] ) {
+               if ( isset( $config['dataLocation'] ) ) {
                        // identifies the location of the search bar for tracking purposes
                        $this->dataLocation = $config['dataLocation'];
                }