MediaWiki  1.34.0
MediaWiki\Widget\Search\BasicSearchResultSetWidget Class Reference

Renders the search result area. More...

Collaboration diagram for MediaWiki\Widget\Search\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. More...
 
 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\Widget\Search\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 108 of file BasicSearchResultSetWidget.php.

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

◆ render()

MediaWiki\Widget\Search\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\Widget\Search\BasicSearchResultSetWidget\header(), ISearchResultSet\INLINE_RESULTS, MediaWiki\Widget\Search\BasicSearchResultSetWidget\renderResultSet(), and ISearchResultSet\SECONDARY_RESULTS.

◆ renderResultSet()

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

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

Member Data Documentation

◆ $resultWidget

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

◆ $sidebarWidget

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

◆ $specialPage

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

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