r45502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45501‎ | r45502 | r45503 >
Date:14:22, 7 January 2009
Author:simetrical
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -906,21 +906,21 @@
907907 }
908908 }
909909
910 - $wgOut->wrapWikiMsg( "==$1==\n", 'notitlematches' );
 910+ $extra = $wgOut->parse( '=='.wfMsgNoTrans( 'notitlematches' )."==\n" );
911911 if( $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) {
912 - $wgOut->addWikiMsg( 'noexactmatch', wfEscapeWikiText( $term ) );
 912+ $extra .= wfMsgExt( 'noexactmatch', 'parse', wfEscapeWikiText( $term ) );
913913 } else {
914 - $wgOut->addWikiMsg( 'noexactmatch-nocreate', wfEscapeWikiText( $term ) );
 914+ $extra .= wfMsgExt( 'noexactmatch-nocreate', 'parse', wfEscapeWikiText( $term ) );
915915 }
916916
917 - return $this->showResults( $term );
 917+ $this->showResults( $term, $extra );
918918 }
919919
920920 /**
921921 * @param string $term
922 - * @public
 922+ * @param string $extra Extra HTML to add after "did you mean"
923923 */
924 - function showResults( $term ) {
 924+ public function showResults( $term, $extra = '' ) {
925925 wfProfileIn( __METHOD__ );
926926 global $wgOut, $wgUser;
927927 $sk = $wgUser->getSkin();
@@ -953,6 +953,8 @@
954954 $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
955955 }
956956
 957+ $wgOut->addHTML( $extra );
 958+
957959 $wgOut->addWikiMsg( 'searchresulttext' );
958960
959961 if( '' === trim( $term ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r46421Fix regression from r45502 -- extra "search" got displayed on old search UI d...brion04:16, 28 January 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45305Make "did you mean" more Googley...simetrical02:17, 2 January 2009

Status & tagging log