Xml::openElement( 'div', array( 'id' => 'mw-search-top-table' ) ) .
$this->shortDialog( $term, $num, $totalRes ) .
Xml::closeElement( 'div' ) .
- $this->formHeader( $term ) .
- Xml::closeElement( 'form' )
+ Xml::closeElement( 'form' ) .
+ $this->didYouMeanHtml .
+ $this->searchProfileTabs( $term )
);
$filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
return;
}
+ $messageName = 'searchmenu-new-nocreate';
$linkClass = 'mw-search-createlink';
- if ( $title->isKnown() ) {
- $messageName = 'searchmenu-exists';
- $linkClass = 'mw-search-exists';
- } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) {
- $messageName = 'searchmenu-new';
- } else {
- $messageName = 'searchmenu-new-nocreate';
+
+ if ( !$title->isExternal() ) {
+ if ( $title->isKnown() ) {
+ $messageName = 'searchmenu-exists';
+ $linkClass = 'mw-search-exists';
+ } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) {
+ $messageName = 'searchmenu-new';
+ }
}
+
$params = array(
$messageName,
wfEscapeWikiText( $title->getPrefixedText() ),
$redirectText = $result->getRedirectSnippet();
$sectionTitle = $result->getSectionTitle();
$sectionText = $result->getSectionSnippet();
- $redirect = '';
+ $categorySnippet = $result->getCategorySnippet();
+ $redirect = '';
if ( !is_null( $redirectTitle ) ) {
if ( $redirectText == '' ) {
$redirectText = null;
}
$section = '';
-
if ( !is_null( $sectionTitle ) ) {
if ( $sectionText == '' ) {
$sectionText = null;
"</span>";
}
+ $category = '';
+ if ( $categorySnippet ) {
+ $category = "<span class='searchalttitle'>" .
+ $this->msg( 'search-category' )->rawParams( $categorySnippet )->text() .
+ "</span>";
+ }
+
// format text extract
$extract = "<div class='searchresult'>" . $result->getTextSnippet( $terms ) . "</div>";
$thumb->toHtml( array( 'desc-link' => true ) ) .
'</td>' .
'<td style="vertical-align: top;">' .
- "{$link} {$redirect} {$section} {$fileMatch}" .
+ "{$link} {$redirect} {$category} {$section} {$fileMatch}" .
$extract .
"<div class='mw-search-result-data'>{$desc} - {$date}</div>" .
'</td>' .
&$html
) ) ) {
$html = "<li><div class='mw-search-result-heading'>" .
- "{$link} {$redirect} {$section} {$fileMatch}</div> {$extract}\n" .
+ "{$link} {$redirect} {$category} {$section} {$fileMatch}</div> {$extract}\n" .
"<div class='mw-search-result-data'>{$size} - {$date}</div>" .
"</li>\n";
}
// be arranged nicely while still accommodating different screen widths
$namespaceTables = '';
for ( $i = 0; $i < $numRows; $i += 4 ) {
- $namespaceTables .= Xml::openElement(
- 'table',
- array( 'cellpadding' => 0, 'cellspacing' => 0 )
- );
+ $namespaceTables .= Xml::openElement( 'table' );
for ( $j = $i; $j < $i + 4 && $j < $numRows; $j++ ) {
$namespaceTables .= Xml::tags( 'tr', null, $rows[$j] );
* @param string $term
* @return string
*/
- protected function formHeader( $term ) {
- $out = Xml::openElement( 'div', array( 'class' => 'mw-search-formheader' ) );
+ protected function searchProfileTabs( $term ) {
+ $out = Xml::openElement( 'div', array( 'class' => 'mw-search-profile-tabs' ) );
$bareterm = $term;
if ( $this->startsWithImage( $term ) ) {
$out .= Html::hidden( 'fulltext', 'Search' ) . "\n";
$out .= Html::submitButton(
$this->msg( 'searchbutton' )->text(),
- array(), array( 'mw-ui-progressive' )
+ array( 'class' => 'mw-ui-button mw-ui-progressive' ),
+ array( 'mw-ui-progressive' )
) . "\n";
// Results-info
Xml::element( 'div', array( 'style' => 'clear:both' ), '', false );
}
- return $out . $this->didYouMeanHtml;
+ return $out;
}
/**