MediaWiki  REL1_31
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. More...
 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 14 of file BasicSearchResultSetWidget.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ header()

MediaWiki\Widget\Search\BasicSearchResultSetWidget::header ( Message  $msg)

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

Message$msgi18n message to use as header
string HTML

Definition at line 109 of file BasicSearchResultSetWidget.php.

References Message\escaped().

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

◆ render()

MediaWiki\Widget\Search\BasicSearchResultSetWidget::render (   $term,
SearchResultSet  $titleResultSet = null,
SearchResultSet  $textResultSet = null 
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.
string HTML

Definition at line 39 of file BasicSearchResultSetWidget.php.

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

◆ renderResultSet()

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

Definition at line 120 of file BasicSearchResultSetWidget.php.

References $wgContLang, global, SearchResultSet\next(), and SearchResultSet\termMatches().

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

Member Data Documentation

◆ $resultWidget

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

◆ $sidebarWidget

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

◆ $specialPage

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

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