use Hooks;
use Html;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Widget\SearchInputWidget;
use MWNamespace;
use SearchEngineConfig;
$offset,
$isPowerSearch
) {
- return Xml::openElement(
+ return '<div class="mw-search-form-wrapper">' .
+ Xml::openElement(
'form',
[
'id' => $isPowerSearch ? 'powersearch' : 'search',
"<div style='clear:both'></div>" .
"</div>" .
$this->optionsHtml( $term, $isPowerSearch, $profile ) .
- '</form>';
+ '</form>' .
+ '</div>';
}
/**
* @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;
}
* @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();
}