Go to the documentation of this file.
50 public function render( $term, $resultSets ) {
51 if ( !is_array( $resultSets ) ) {
52 $resultSets = [ $resultSets ];
58 foreach ( $resultSets as $resultSet ) {
59 foreach ( $resultSet as $result ) {
60 if ( !$result->isBrokenTitle() ) {
61 $iwResults[$result->getTitle()->getInterwiki()][] = $result;
67 foreach ( $iwResults as $iwPrefix => $results ) {
69 $out .=
"<ul class='mw-search-iwresults'>";
72 foreach ( $results as $result ) {
73 $out .= $this->resultWidget->render( $result, $term, $position++ );
78 return "<div id='mw-search-interwiki'>" .
79 "<div id='mw-search-interwiki-caption'>" .
80 $this->specialSearch->msg(
'search-interwiki-caption' )->parse() .
94 if ( isset( $this->customCaptions[$iwPrefix] ) ) {
95 $caption = $this->customCaptions[$iwPrefix];
97 $interwiki = $this->iwLookup->fetch( $iwPrefix );
99 $caption = $this->specialSearch->msg(
'search-interwiki-default', $parsed[
'host'] )->escaped();
103 [
'search' => $term,
'fulltext' => 1 ]
108 $this->specialSearch->msg(
'search-interwiki-more' )->escaped()
111 return "<div class='mw-search-interwiki-project'>" .
112 "<span class='mw-search-interwiki-more'>{$searchLink}</span>" .
118 if ( $this->customCaptions !==
null ) {
122 $this->customCaptions = [];
123 $customLines = explode(
"\n", $this->specialSearch->msg(
'search-interwiki-custom' )->escaped() );
124 foreach ( $customLines as
$line ) {
125 $parts = explode(
':',
$line, 2 );
126 if ( count( $parts ) === 2 ) {
127 $this->customCaptions[$parts[0]] = $parts[1];
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
A set of SearchEngine results.
implements Special:Search - Run text & title search and display the output
Represents a title within MediaWiki.
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
This class is a collection of static functions that serve two purposes: