function getInterwikiPrefix() {
return '';
}
+
+ /**
+ * Did this match file contents (eg: PDF/DJVU)?
+ */
+ function isFileMatch() {
+ return false;
+ }
}
/**
* A SearchResultSet wrapper for SearchEngine::getNearMatch
);
}
+ $fileMatch = '';
// Include a thumbnail for media files...
if ( $t->getNamespace() == NS_FILE ) {
$img = $result->getFile();
$img = $img ?: wfFindFile( $t );
+ if ( $result->isFileMatch() ) {
+ $fileMatch = "<span class='searchalttitle'>" .
+ $this->msg( 'search-file-match' )->escaped() . "</span>";
+ }
if ( $img ) {
$thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
if ( $thumb ) {
$thumb->toHtml( array( 'desc-link' => true ) ) .
'</td>' .
'<td style="vertical-align: top;">' .
- $link .
+ "{$link} {$fileMatch}" .
$extract .
"<div class='mw-search-result-data'>{$score}{$desc} - {$date}{$related}</div>" .
'</td>' .
&$score, &$size, &$date, &$related,
&$html
) ) ) {
- $html = "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section}</div> {$extract}\n" .
+ $html = "<li><div class='mw-search-result-heading'>{$link} {$redirect} {$section} {$fileMatch}</div> {$extract}\n" .
"<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
"</li>\n";
}
'search-result-score' => 'Relevance: $1%',
'search-redirect' => '(redirect $1)',
'search-section' => '(section $1)',
+'search-file-match' => '(matches file content)',
'search-suggest' => 'Did you mean: $1',
'search-interwiki-caption' => 'Sister projects',
'search-interwiki-default' => '$1 results:',
* \$1 - a link to the redirect to the page (so, \$1 is the page that the search result is redirected '''from''')",
'search-section' => 'This text will be shown on the search result listing after the page title of a result if the search algorithm thinks that section is more relevant than the rest of the page. $1 is a section title.
{{Identical|Section}}',
+'search-file-match' => 'This text will be shown on the search result listing after the page title of a result if the search engine got search results from the contents of files, rather than the pages.',
'search-suggest' => 'Used for "Did you mean" suggestions:
* $1 - suggested link',
'search-interwiki-caption' => 'Used in [[Special:Search]], when showing search results from other wikis.',
'search-result-score',
'search-redirect',
'search-section',
+ 'search-file-match',
'search-suggest',
'search-interwiki-caption',
'search-interwiki-default',