From: Aryeh Gregor Date: Wed, 7 Jan 2009 14:22:45 +0000 (+0000) Subject: Make sure that "did you mean" displays at the top X-Git-Tag: 1.31.0-rc.0~43518 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a92f6ad9f63ffdd92aa4fe8cceb1b06217610bb2;p=lhc%2Fweb%2Fwiklou.git Make sure that "did you mean" displays at the top r45305 only fully worked if some search results were displayed. This should work even if none are. --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index f3117242d1..fd712d99d0 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -906,21 +906,21 @@ class SpecialSearchOld { } } - $wgOut->wrapWikiMsg( "==$1==\n", 'notitlematches' ); + $extra = $wgOut->parse( '=='.wfMsgNoTrans( 'notitlematches' )."==\n" ); if( $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) { - $wgOut->addWikiMsg( 'noexactmatch', wfEscapeWikiText( $term ) ); + $extra .= wfMsgExt( 'noexactmatch', 'parse', wfEscapeWikiText( $term ) ); } else { - $wgOut->addWikiMsg( 'noexactmatch-nocreate', wfEscapeWikiText( $term ) ); + $extra .= wfMsgExt( 'noexactmatch-nocreate', 'parse', wfEscapeWikiText( $term ) ); } - return $this->showResults( $term ); + $this->showResults( $term, $extra ); } /** * @param string $term - * @public + * @param string $extra Extra HTML to add after "did you mean" */ - function showResults( $term ) { + public function showResults( $term, $extra = '' ) { wfProfileIn( __METHOD__ ); global $wgOut, $wgUser; $sk = $wgUser->getSkin(); @@ -953,6 +953,8 @@ class SpecialSearchOld { $wgOut->addHTML('
'.wfMsg('search-suggest',$suggestLink).'
'); } + $wgOut->addHTML( $extra ); + $wgOut->addWikiMsg( 'searchresulttext' ); if( '' === trim( $term ) ) {