X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fwidget%2Fsearch%2FSearchFormWidget.php;h=7eb92fdfd6a1d1a8571c6b7c9ca9a55e5bdd2282;hb=73380233aab4e2009acdbaa8d6ac928c499408af;hp=2302177f2864d260f71c1e0694ed60f25d5bbf62;hpb=4533986087e6eec9c5bd2542705b4ab1dd7869a7;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/widget/search/SearchFormWidget.php b/includes/widget/search/SearchFormWidget.php
index 2302177f28..7eb92fdfd6 100644
--- a/includes/widget/search/SearchFormWidget.php
+++ b/includes/widget/search/SearchFormWidget.php
@@ -4,6 +4,7 @@ namespace MediaWiki\Widget\Search;
use Hooks;
use Html;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Widget\SearchInputWidget;
use MWNamespace;
use SearchEngineConfig;
@@ -50,7 +51,8 @@ class SearchFormWidget {
$offset,
$isPowerSearch
) {
- return Xml::openElement(
+ return '
" .
$this->optionsHtml( $term, $isPowerSearch, $profile ) .
- '';
+ '' .
+ '';
}
/**
@@ -169,11 +172,10 @@ class SearchFormWidget {
* @return bool
*/
protected function startsWithImage( $term ) {
- global $wgContLang;
-
$parts = explode( ':', $term );
return count( $parts ) > 1
- ? $wgContLang->getNsIndex( $parts[0] ) === NS_FILE
+ ? MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( $parts[0] ) ===
+ NS_FILE
: false;
}
@@ -234,17 +236,16 @@ class SearchFormWidget {
* @return string HTML
*/
protected function powerSearchBox( $term, array $opts ) {
- global $wgContLang;
-
$rows = [];
$activeNamespaces = $this->specialSearch->getNamespaces();
+ $langConverter = MediaWikiServices::getInstance()->getContentLanguage()->getConverter();
foreach ( $this->searchConfig->searchableNamespaces() as $namespace => $name ) {
$subject = MWNamespace::getSubject( $namespace );
if ( !isset( $rows[$subject] ) ) {
$rows[$subject] = "";
}
- $name = $wgContLang->getConverter()->convertNamespace( $namespace );
+ $name = $langConverter->convertNamespace( $namespace );
if ( $name === '' ) {
$name = $this->specialSearch->msg( 'blanknamespace' )->text();
}