MediaWiki REL1_35
MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget Class Reference

Renders one or more ISearchResultSets into a sidebar grouped by interwiki prefix. More...

Inheritance diagram for MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget:
Collaboration diagram for MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget:

Public Member Functions

 __construct (SpecialSearch $specialSearch, SearchResultWidget $resultWidget, LinkRenderer $linkRenderer, InterwikiLookup $iwLookup, $showMultimedia=false)
 
 render ( $term, $resultSets)
 

Protected Member Functions

 footerHtml ( $term, $iwPrefix)
 Generates an HTML footer for the given interwiki prefix.
 
 iwIcon ( $iwPrefix)
 Generates a custom OOUI icon element with a favicon as the image.
 
 loadCustomCaptions ()
 

Protected Attributes

string[] null $customCaptions
 
InterwikiLookup $iwLookup
 
LinkRenderer $linkRenderer
 
OutputPage $output
 
SearchResultWidget $resultWidget
 
bool $showMultimedia
 
SpecialSearch $specialSearch
 

Detailed Description

Renders one or more ISearchResultSets into a sidebar grouped by interwiki prefix.

Includes a per-wiki header indicating where the results are from.

Definition at line 18 of file InterwikiSearchResultSetWidget.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ footerHtml()

MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::footerHtml (   $term,
  $iwPrefix 
)
protected

Generates an HTML footer for the given interwiki prefix.

Parameters
string$termUser provided search term
string$iwPrefixInterwiki prefix of wiki to show footer for
Returns
string HTML

Definition at line 124 of file InterwikiSearchResultSetWidget.php.

References MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget\iwIcon(), NS_SPECIAL, wfExpandUrl(), and wfParseUrl().

Referenced by MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget\render().

◆ iwIcon()

MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::iwIcon (   $iwPrefix)
protected

Generates a custom OOUI icon element with a favicon as the image.

The favicon image URL is generated by parsing the interwiki URL and returning the default location of the favicon for that domain, which is assumed to be '/favicon.ico'.

Parameters
string$iwPrefixInterwiki prefix
Returns
OOUI\IconWidget

Definition at line 168 of file InterwikiSearchResultSetWidget.php.

References wfExpandUrl(), and wfParseUrl().

Referenced by MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget\footerHtml().

◆ loadCustomCaptions()

MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::loadCustomCaptions ( )
protected

◆ render()

MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::render (   $term,
  $resultSets 
)

Member Data Documentation

◆ $customCaptions

string [] null MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$customCaptions
protected

Definition at line 24 of file InterwikiSearchResultSetWidget.php.

◆ $iwLookup

InterwikiLookup MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$iwLookup
protected

◆ $linkRenderer

LinkRenderer MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$linkRenderer
protected

◆ $output

OutputPage MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$output
protected

Definition at line 30 of file InterwikiSearchResultSetWidget.php.

◆ $resultWidget

SearchResultWidget MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$resultWidget
protected

◆ $showMultimedia

bool MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$showMultimedia
protected

◆ $specialSearch

SpecialSearch MediaWiki\Search\SearchWidgets\InterwikiSearchResultSetWidget::$specialSearch
protected

The documentation for this class was generated from the following file: