Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / widget / search / SearchFormWidget.php
index 735806b..66b6566 100644 (file)
@@ -6,7 +6,6 @@ use Hooks;
 use Html;
 use MediaWiki\MediaWikiServices;
 use MediaWiki\Widget\SearchInputWidget;
-use MWNamespace;
 use SearchEngineConfig;
 use SpecialSearch;
 use Xml;
@@ -238,14 +237,15 @@ class SearchFormWidget {
        protected function powerSearchBox( $term, array $opts ) {
                $rows = [];
                $activeNamespaces = $this->specialSearch->getNamespaces();
+               $langConverter = $this->specialSearch->getLanguage();
                foreach ( $this->searchConfig->searchableNamespaces() as $namespace => $name ) {
-                       $subject = MWNamespace::getSubject( $namespace );
+                       $subject = MediaWikiServices::getInstance()->getNamespaceInfo()->
+                               getSubject( $namespace );
                        if ( !isset( $rows[$subject] ) ) {
                                $rows[$subject] = "";
                        }
 
-                       $name = MediaWikiServices::getInstance()->getContentLanguage()->getConverter()->
-                               convertNamespace( $namespace );
+                       $name = $langConverter->convertNamespace( $namespace );
                        if ( $name === '' ) {
                                $name = $this->specialSearch->msg( 'blanknamespace' )->text();
                        }
@@ -305,8 +305,14 @@ class SearchFormWidget {
                return "<fieldset id='mw-searchoptions'>" .
                        "<legend>" . $this->specialSearch->msg( 'powersearch-legend' )->escaped() . '</legend>' .
                        "<h4>" . $this->specialSearch->msg( 'powersearch-ns' )->parse() . '</h4>' .
-                       // populated by js if available
-                       "<div id='mw-search-togglebox'></div>" .
+                       // Handled by JavaScript if available
+                       '<div id="mw-search-togglebox">' .
+                       '<label>' . $this->specialSearch->msg( 'powersearch-togglelabel' )->escaped() . '</label>' .
+                       '<input type="button" id="mw-search-toggleall" value="' .
+                       $this->specialSearch->msg( 'powersearch-toggleall' )->escaped() . '"/>' .
+                       '<input type="button" id="mw-search-togglenone" value="' .
+                       $this->specialSearch->msg( 'powersearch-togglenone' )->escaped() . '"/>' .
+                       '</div>' .
                        $divider .
                        implode(
                                $divider,