r56542 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56541‎ | r56542 | r56543 >
Date:17:25, 17 September 2009
Author:brion
Status:ok
Tags:
Comment:
Merge r56540 search fix from trunk
Modified paths:
  • /branches/wmf-deployment/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/specials/SpecialSearch.php
@@ -261,6 +261,8 @@
262262
263263 // prev/next links
264264 if( $num || $this->offset ) {
 265+ // Show the create link ahead
 266+ $this->showCreateLink( $t );
265267 $prevnext = wfViewPrevNext( $this->offset, $this->limit,
266268 SpecialPage::getTitleFor( 'Search' ),
267269 wfArrayToCGI( $this->powerSearchOptions(), array( 'search' => $term ) ),
@@ -301,8 +303,22 @@
302304 }
303305 if( $num === 0 ) {
304306 $wgOut->addWikiMsg( 'search-nonefound', wfEscapeWikiText( $term ) );
 307+ $this->showCreateLink( $t );
305308 }
 309+ $wgOut->addHtml( "</div>" );
 310+ if( $num === 0 ) {
 311+ $wgOut->addHTML( $this->searchFocus() );
 312+ }
306313
 314+ if( $num || $this->offset ) {
 315+ $wgOut->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
 316+ }
 317+ wfProfileOut( __METHOD__ );
 318+ }
 319+
 320+ protected function showCreateLink( $t ) {
 321+ global $wgOut;
 322+
307323 // show direct page/create link
308324 if( !is_null($t) ) {
309325 if( !$t->exists() ) {
@@ -314,15 +330,6 @@
315331 // preserve the paragraph for margins etc...
316332 $wgOut->addHTML('<p></p>');
317333 }
318 - $wgOut->addHtml( "</div>" );
319 - if( $num === 0 ) {
320 - $wgOut->addHTML( $this->searchFocus() );
321 - }
322 -
323 - if( $num || $this->offset ) {
324 - $wgOut->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
325 - }
326 - wfProfileOut( __METHOD__ );
327334 }
328335
329336 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56540Fix for r55592: show the direct-page link/create link on search *above* actua...brion17:23, 17 September 2009

Status & tagging log