For search, move "create page" below "no results"
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 26 Aug 2009 14:34:28 +0000 (14:34 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 26 Aug 2009 14:34:28 +0000 (14:34 +0000)
This looks slightly less odd, with the user no longer being told to
create the page before they're even told it doesn't exist.  But it still
looks pretty odd.

includes/specials/SpecialSearch.php

index abe645b..dfdd25d 100644 (file)
@@ -258,18 +258,6 @@ class SpecialSearch {
                
                $wgOut->addHtml( Xml::closeElement( 'form' ) );
                $wgOut->addHtml( "<div class='searchresults'>" );
-               
-               // show direct page/create link
-               if( !is_null($t) ) {
-                       if( !$t->exists() ) {
-                               $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $t->getPrefixedText() ) );
-                       } else {
-                               $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $t->getPrefixedText() ) );
-                       }
-               } else {
-                       // preserve the paragraph for margins etc...
-                       $wgOut->addHTML('<p></p>');
-               }
 
                // prev/next links
                if( $num || $this->offset ) {
@@ -314,6 +302,18 @@ class SpecialSearch {
                if( $num === 0 ) {
                        $wgOut->addWikiMsg( 'search-nonefound', wfEscapeWikiText( $term ) );
                }
+
+               // show direct page/create link
+               if( !is_null($t) ) {
+                       if( !$t->exists() ) {
+                               $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $t->getPrefixedText() ) );
+                       } else {
+                               $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $t->getPrefixedText() ) );
+                       }
+               } else {
+                       // preserve the paragraph for margins etc...
+                       $wgOut->addHTML('<p></p>');
+               }
                $wgOut->addHtml( "</div>" );
                if( $num === 0 ) {
                        $wgOut->addHTML( $this->searchFocus() );