From aa1609ad57a328b2865659f67d43fbc4c11ae8f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 27 Apr 2009 07:25:51 +0000 Subject: [PATCH] * Remove trailing whitespace --- includes/specials/SpecialSearch.php | 228 ++++++++++++++-------------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index b5e571a054..477d818fd2 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -37,8 +37,8 @@ function wfSpecialSearch( $par = '' ) { $search = str_replace( "\n", " ", $wgRequest->getText( 'search', $titleParam ) ); $class = $wgUseOldSearchUI ? 'SpecialSearchOld' : 'SpecialSearch'; $searchPage = new $class( $wgRequest, $wgUser ); - if( $wgRequest->getVal( 'fulltext' ) - || !is_null( $wgRequest->getVal( 'offset' )) + if( $wgRequest->getVal( 'fulltext' ) + || !is_null( $wgRequest->getVal( 'offset' )) || !is_null( $wgRequest->getVal( 'searchx' )) ) { $searchPage->showResults( $search ); @@ -74,7 +74,7 @@ class SpecialSearch { $this->active = 'advanced'; $this->sk = $user->getSkin(); $this->didYouMeanHtml = ''; # html of did you mean... link - $this->fulltext = $request->getVal('fulltext'); + $this->fulltext = $request->getVal('fulltext'); } /** @@ -116,9 +116,9 @@ class SpecialSearch { public function showResults( $term ) { global $wgOut, $wgUser, $wgDisableTextSearch, $wgContLang; wfProfileIn( __METHOD__ ); - + $sk = $wgUser->getSkin(); - + $this->searchEngine = SearchEngine::create(); $search =& $this->searchEngine; $search->setLimitOffset( $this->limit, $this->offset ); @@ -126,9 +126,9 @@ class SpecialSearch { $search->showRedirects = $this->searchRedirects; $search->prefix = $this->mPrefix; $term = $search->transformSearchTerm($term); - + $this->setupPage( $term ); - + if( $wgDisableTextSearch ) { global $wgSearchForwardUrl; if( $wgSearchForwardUrl ) { @@ -152,10 +152,10 @@ class SpecialSearch { wfProfileOut( __METHOD__ ); return; } - + $t = Title::newFromText( $term ); - - // fetch search results + + // fetch search results $rewritten = $search->replacePrefixes($term); $titleMatches = $search->searchTitle( $rewritten ); @@ -168,8 +168,8 @@ class SpecialSearch { # mirror Go/Search behaviour of original request .. $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() ); if($this->fulltext != NULL) - $didYouMeanParams['fulltext'] = $this->fulltext; - $stParams = wfArrayToCGI( + $didYouMeanParams['fulltext'] = $this->fulltext; + $stParams = wfArrayToCGI( $didYouMeanParams, $this->powerSearchOptions() ); @@ -179,9 +179,9 @@ class SpecialSearch { $this->didYouMeanHtml = '
'.wfMsg('search-suggest',$suggestLink).'
'; } - - // start rendering the page - $wgOut->addHtml( + + // start rendering the page + $wgOut->addHtml( Xml::openElement( 'table', array( 'border'=>0, 'cellpadding'=>0, 'cellspacing'=>0 ) ) . Xml::openElement( 'tr' ) . Xml::openElement( 'td' ) . "\n" . @@ -190,14 +190,14 @@ class SpecialSearch { Xml::closeElement('tr') . Xml::closeElement('table') ); - + // Sometimes the search engine knows there are too many hits if( $titleMatches instanceof SearchResultTooMany ) { $wgOut->addWikiText( '==' . wfMsg( 'toomanymatches' ) . "==\n" ); wfProfileOut( __METHOD__ ); return; } - + $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':'; if( '' === trim( $term ) || $filePrefix === trim( $term ) ) { $wgOut->addHTML( $this->searchAdvanced ? $this->powerSearchFocus() : $this->searchFocus() ); @@ -230,7 +230,7 @@ class SpecialSearch { // show number of results and current offset if( $numSQL > 0 ) { if( $numSQL > 0 ) { - $top = wfMsgExt('showingresultstotal', array( 'parseinline' ), + $top = wfMsgExt('showingresultstotal', array( 'parseinline' ), $this->offset+1, $this->offset+$numSQL, $totalRes, $numSQL ); } elseif( $numSQL >= $this->limit ) { $top = wfShowingResults( $this->offset, $this->limit ); @@ -265,7 +265,7 @@ class SpecialSearch { // output appropriate heading if( $numTextMatches > 0 && $numTitleMatches > 0 ) { // if no title matches the heading is redundant - $wgOut->wrapWikiMsg( "==$1==\n", 'textmatches' ); + $wgOut->wrapWikiMsg( "==$1==\n", 'textmatches' ); } elseif( $totalRes == 0 ) { # Don't show the 'no text matches' if we received title matches $wgOut->wrapWikiMsg( "==$1==\n", 'notextmatches' ); @@ -294,7 +294,7 @@ class SpecialSearch { } wfProfileOut( __METHOD__ ); } - + /** * */ @@ -319,7 +319,7 @@ class SpecialSearch { if( !empty( $term ) ) { $wgOut->setPageTitle( wfMsg( 'searchresults') ); $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'searchresults-title', $term ) ) ); - } + } $wgOut->setArticleRelated( false ); $wgOut->setRobotPolicy( 'noindex,nofollow' ); } @@ -358,8 +358,8 @@ class SpecialSearch { } /** - * Show whole set of results - * + * Show whole set of results + * * @param SearchResultSet $matches */ protected function showMatches( &$matches ) { @@ -433,13 +433,13 @@ class SpecialSearch { .""; $section = ''; if( !is_null($sectionTitle) ) - $section = "" + $section = "" .wfMsg('search-section', $this->sk->makeKnownLinkObj( $sectionTitle, $sectionText)) .""; // format text extract $extract = "
".$result->getTextSnippet($terms)."
"; - + // format score if( is_null( $result->getScore() ) ) { // Search engine doesn't report scoring info @@ -465,7 +465,7 @@ class SpecialSearch { $stParams = wfArrayToCGI( $this->powerSearchOptions(), array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(), 'fulltext' => wfMsg('search') )); - + $related = ' -- ' . $sk->makeKnownLinkObj( $st, wfMsg('search-relatedarticle'), $stParams ); } @@ -508,7 +508,7 @@ class SpecialSearch { /** * Show results from other wikis - * + * * @param SearchResultSet $matches */ protected function showInterwiki( &$matches, $query ) { @@ -517,7 +517,7 @@ class SpecialSearch { $terms = $wgContLang->convertForSearchResult( $matches->termMatches() ); $out = "
". - wfMsg('search-interwiki-caption')."
\n"; + wfMsg('search-interwiki-caption')."
\n"; $off = $this->offset + 1; $out .= "
{$searchLink}{$caption}
\n