Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -131,6 +131,7 @@ |
132 | 132 | |
133 | 133 | $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':'; |
134 | 134 | if( '' === trim( $term ) || $filePrefix === trim( $term ) ) { |
| 135 | + $wgOut->addHTML( $this->searchAdvanced ? $this->powerSearchFocus() : $this->searchFocus() ); |
135 | 136 | // Empty query -- straight view of search form |
136 | 137 | wfProfileOut( __METHOD__ ); |
137 | 138 | return; |
— | — | @@ -269,6 +270,9 @@ |
270 | 271 | $wgOut->addWikiMsg( 'search-nonefound' ); |
271 | 272 | } |
272 | 273 | $wgOut->addHtml( "</div>" ); |
| 274 | + if( $totalRes === 0 ) { |
| 275 | + $wgOut->addHTML( $this->searchAdvanced ? $this->powerSearchFocus() : $this->searchFocus() ); |
| 276 | + } |
273 | 277 | |
274 | 278 | if( $numSQL || $this->offset ) { |
275 | 279 | $wgOut->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" ); |
— | — | @@ -619,8 +623,7 @@ |
620 | 624 | if( $t != null && count($this->namespaces) === 1 ) { |
621 | 625 | $out .= wfMsgExt( 'searchmenu-prefix', array('parseinline'), $term ); |
622 | 626 | } |
623 | | - return $this->powerSearchFocus() . |
624 | | - Xml::openElement( 'fieldset', array('id' => 'mw-searchoptions','style' => 'margin:0em;') ) . |
| 627 | + return Xml::openElement( 'fieldset', array('id' => 'mw-searchoptions','style' => 'margin:0em;') ) . |
625 | 628 | Xml::element( 'legend', null, wfMsg('powersearch-legend') ) . |
626 | 629 | $this->formHeader($term) . $out . |
627 | 630 | Xml::closeElement( 'fieldset' ); |
— | — | @@ -724,8 +727,7 @@ |
725 | 728 | global $wgScript; |
726 | 729 | $searchTitle = SpecialPage::getTitleFor( 'Search' ); |
727 | 730 | $searchable = SearchEngine::searchableNamespaces(); |
728 | | - $out = $this->searchFocus(); |
729 | | - $out .= Xml::openElement( 'form', array( 'id' => 'search', 'method' => 'get', 'action' => $wgScript ) ); |
| 731 | + $out = Xml::openElement( 'form', array( 'id' => 'search', 'method' => 'get', 'action' => $wgScript ) ); |
730 | 732 | $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n"; |
731 | 733 | // If searching several, but not all namespaces, show what we are searching. |
732 | 734 | if( count($this->namespaces) > 1 && $this->namespaces !== array_keys($searchable) ) { |