47 $hasTitle = $titleResultSet ? $titleResultSet->numRows() > 0 :
false;
48 $hasText = $textResultSet ? $textResultSet->numRows() > 0 :
false;
49 $hasSecondary = $textResultSet
50 ? $textResultSet->hasInterwikiResults( SearchResultSet::SECONDARY_RESULTS )
52 $hasSecondaryInline = $textResultSet
53 ? $textResultSet->hasInterwikiResults( SearchResultSet::INLINE_RESULTS )
56 if ( !$hasTitle && !$hasText && !$hasSecondary && !$hasSecondaryInline ) {
62 $out .= $this->
header( $this->specialPage->msg(
'titlematches' ) )
68 $out .=
"<div class='mw-search-visualclear'></div>" .
69 $this->
header( $this->specialPage->msg(
'textmatches' ) );
74 if ( $hasSecondaryInline ) {
75 $iwResults = $textResultSet->getInterwikiResults( SearchResultSet::INLINE_RESULTS );
76 foreach ( $iwResults as $interwiki => $results ) {
77 if ( $results instanceof
Status || $results->numRows() === 0 ) {
82 "<h2 class='mw-search-interwiki-header mw-search-visualclear'>" .
83 $this->specialPage->msg(
"search-interwiki-results-{$interwiki}" )->parse() .
89 if ( $hasSecondary ) {
90 $out .= $this->sidebarWidget->render(
92 $textResultSet->getInterwikiResults( SearchResultSet::SECONDARY_RESULTS )
111 "<span class='mw-headline'>" . $msg->escaped() .
"</span>" .
126 $result = $resultSet->
next();
128 $hits[] .= $this->resultWidget->render( $result, $terms, $offset++ );
129 $result = $resultSet->
next();
132 return "<ul class='mw-search-results'>" . implode(
'', $hits ) .
"</ul>";
The Message class provides methods which fulfil two basic services:
next()
Fetches next search result, or false.
termMatches()
Fetch an array of regular expression fragments for matching the search terms as parsed by this engine...
implements Special:Search - Run text & title search and display the output
Generic operation result class Has warning/error list, boolean status and arbitrary value.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
For QUnit the mediawiki tests qunit testrunner dependency will be added to any module whereas SearchGetNearMatch runs after $term
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out