MediaWiki REL1_33
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, SearchResultSet $titleResultSet=null, SearchResultSet $textResultSet=null)
 

Protected Member Functions

 header (Message $msg)
 Generate a headline for a section of the search results.
 
 renderResultSet (SearchResultSet $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.

References Message\escaped().

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

◆ render()

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

Definition at line 40 of file BasicSearchResultSetWidget.php.

References $out, $term, as, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Widget\Search\BasicSearchResultSetWidget\header(), and MediaWiki\Widget\Search\BasicSearchResultSetWidget\renderResultSet().

◆ renderResultSet()

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

Definition at line 119 of file BasicSearchResultSetWidget.php.

References as, MediaWiki\MediaWikiServices\getInstance(), and SearchResultSet\termMatches().

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: