dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add type hint for ParserOutput"
[lhc/web/wiklou.git]
/
includes
/
widget
/
search
/
SearchFormWidget.php
diff --git
a/includes/widget/search/SearchFormWidget.php
b/includes/widget/search/SearchFormWidget.php
index
2c88563
..
735806b
100644
(file)
--- 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 Hooks;
use Html;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Widget\SearchInputWidget;
use MWNamespace;
use SearchEngineConfig;
use MediaWiki\Widget\SearchInputWidget;
use MWNamespace;
use SearchEngineConfig;
@@
-50,7
+51,8
@@
class SearchFormWidget {
$offset,
$isPowerSearch
) {
$offset,
$isPowerSearch
) {
- return Xml::openElement(
+ return '<div class="mw-search-form-wrapper">' .
+ Xml::openElement(
'form',
[
'id' => $isPowerSearch ? 'powersearch' : 'search',
'form',
[
'id' => $isPowerSearch ? 'powersearch' : 'search',
@@
-67,7
+69,8
@@
class SearchFormWidget {
"<div style='clear:both'></div>" .
"</div>" .
$this->optionsHtml( $term, $isPowerSearch, $profile ) .
"<div style='clear:both'></div>" .
"</div>" .
$this->optionsHtml( $term, $isPowerSearch, $profile ) .
- '</form>';
+ '</form>' .
+ '</div>';
}
/**
}
/**
@@
-100,6
+103,10
@@
class SearchFormWidget {
$html .= $layout;
$html .= $layout;
+ if ( $this->specialSearch->getPrefix() !== '' ) {
+ $html .= Html::hidden( 'prefix', $this->specialSearch->getPrefix() );
+ }
+
if ( $totalResults > 0 && $offset < $totalResults ) {
$html .= Xml::tags(
'div',
if ( $totalResults > 0 && $offset < $totalResults ) {
$html .= Xml::tags(
'div',
@@
-165,11
+172,10
@@
class SearchFormWidget {
* @return bool
*/
protected function startsWithImage( $term ) {
* @return bool
*/
protected function startsWithImage( $term ) {
- global $wgContLang;
-
$parts = explode( ':', $term );
return count( $parts ) > 1
$parts = explode( ':', $term );
return count( $parts ) > 1
- ? $wgContLang->getNsIndex( $parts[0] ) === NS_FILE
+ ? MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( $parts[0] ) ===
+ NS_FILE
: false;
}
: false;
}
@@
-230,8
+236,6
@@
class SearchFormWidget {
* @return string HTML
*/
protected function powerSearchBox( $term, array $opts ) {
* @return string HTML
*/
protected function powerSearchBox( $term, array $opts ) {
- global $wgContLang;
-
$rows = [];
$activeNamespaces = $this->specialSearch->getNamespaces();
foreach ( $this->searchConfig->searchableNamespaces() as $namespace => $name ) {
$rows = [];
$activeNamespaces = $this->specialSearch->getNamespaces();
foreach ( $this->searchConfig->searchableNamespaces() as $namespace => $name ) {
@@
-240,7
+244,8
@@
class SearchFormWidget {
$rows[$subject] = "";
}
$rows[$subject] = "";
}
- $name = $wgContLang->getConverter()->convertNamespace( $namespace );
+ $name = MediaWikiServices::getInstance()->getContentLanguage()->getConverter()->
+ convertNamespace( $namespace );
if ( $name === '' ) {
$name = $this->specialSearch->msg( 'blanknamespace' )->text();
}
if ( $name === '' ) {
$name = $this->specialSearch->msg( 'blanknamespace' )->text();
}
@@
-270,7
+275,7
@@
class SearchFormWidget {
$showSections = [
'namespaceTables' => "<table>" . implode( '</table><table>', $namespaceTables ) . '</table>',
];
$showSections = [
'namespaceTables' => "<table>" . implode( '</table><table>', $namespaceTables ) . '</table>',
];
- Hooks::run( 'SpecialSearchPowerBox', [ &$showSections, $term, $opts ] );
+ Hooks::run( 'SpecialSearchPowerBox', [ &$showSections, $term,
&
$opts ] );
$hidden = '';
foreach ( $opts as $key => $value ) {
$hidden = '';
foreach ( $opts as $key => $value ) {