MediaWiki REL1_35
MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget Class Reference

Renders the search result area. More...

Collaboration diagram for MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget:

Public Member Functions

 __construct (SpecialSearch $specialPage, SearchResultWidget $resultWidget, SearchResultSetWidget $sidebarWidget)
 
 render ( $term, $offset, ISearchResultSet $titleResultSet=null, ISearchResultSet $textResultSet=null)
 

Protected Member Functions

 header (Message $msg)
 Generate a headline for a section of the search results.
 
 renderResultSet (ISearchResultSet $resultSet, $offset)
 

Protected Attributes

SearchResultWidget $resultWidget
 
InterwikiSearchResultSetWidget $sidebarWidget
 
SpecialSearch $specialPage
 

Detailed Description

Renders the search result area.

Handles Title and Full-Text search results, along with inline and sidebar secondary (interwiki) results.

Definition at line 15 of file BasicSearchResultSetWidget.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ header()

MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget::header ( Message  $msg)
protected

Generate a headline for a section of the search results.

In prior implementations this was rendering wikitext of '==$1==', but seems a waste to call the full parser to generate this tiny bit of html

Parameters
Message$msgi18n message to use as header
Returns
string HTML

Definition at line 110 of file BasicSearchResultSetWidget.php.

References Message\escaped().

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

◆ render()

MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget::render (   $term,
  $offset,
ISearchResultSet  $titleResultSet = null,
ISearchResultSet  $textResultSet = null 
)
Parameters
string$termThe search term to highlight
int$offsetThe offset of the first result in the result set
ISearchResultSet | null$titleResultSetResults of searching only page titles
ISearchResultSet | null$textResultSetResults of general full text search.
Returns
string HTML

Definition at line 40 of file BasicSearchResultSetWidget.php.

References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\header(), and MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget\renderResultSet().

◆ renderResultSet()

MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget::renderResultSet ( ISearchResultSet  $resultSet,
  $offset 
)
protected
Parameters
ISearchResultSet$resultSetThe search results to render
int$offsetOffset of the first result in $resultSet
Returns
string HTML

Definition at line 121 of file BasicSearchResultSetWidget.php.

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

Member Data Documentation

◆ $resultWidget

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

◆ $sidebarWidget

InterwikiSearchResultSetWidget MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget::$sidebarWidget
protected

◆ $specialPage

SpecialSearch MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget::$specialPage
protected

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