MediaWiki  master
MediaWiki\Widget\Search\InterwikiSearchResultSetWidget Class Reference

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

Inheritance diagram for MediaWiki\Widget\Search\InterwikiSearchResultSetWidget:
Collaboration diagram for MediaWiki\Widget\Search\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. More...
 
 iwIcon ($iwPrefix)
 Generates a custom OOUI icon element with a favicon as the image. More...
 
 loadCustomCaptions ()
 

Protected Attributes

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

Detailed Description

Renders one or more SearchResultSets 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

Member Function Documentation

MediaWiki\Widget\Search\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 125 of file InterwikiSearchResultSetWidget.php.

References $term, MediaWiki\Widget\Search\InterwikiSearchResultSetWidget\iwIcon(), Title\makeTitle(), NS_SPECIAL, Html\rawElement(), wfExpandUrl(), and wfParseUrl().

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

MediaWiki\Widget\Search\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 173 of file InterwikiSearchResultSetWidget.php.

References wfExpandUrl(), and wfParseUrl().

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

MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::loadCustomCaptions ( )
protected
MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::render (   $term,
  $resultSets 
)
Parameters
string$termUser provided search term
SearchResultSet|SearchResultSet[]$resultSets List of interwiki results to render.
Returns
string HTML

Implements MediaWiki\Widget\Search\SearchResultSetWidget.

Definition at line 54 of file InterwikiSearchResultSetWidget.php.

References $term, OutputPage\addModules(), OutputPage\addModuleStyles(), as, MediaWiki\Widget\Search\InterwikiSearchResultSetWidget\footerHtml(), MediaWiki\Widget\Search\InterwikiSearchResultSetWidget\loadCustomCaptions(), output(), and Html\rawElement().

Member Data Documentation

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

Definition at line 24 of file InterwikiSearchResultSetWidget.php.

InterwikiLookup MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$iwLookup
protected
LinkRenderer MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$linkRenderer
protected
$output MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$output
protected

Definition at line 30 of file InterwikiSearchResultSetWidget.php.

SearchResultWidget MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$resultWidget
protected
MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$showMultimedia
protected
SpecialSearch MediaWiki\Widget\Search\InterwikiSearchResultSetWidget::$specialSearch
protected

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