Merge "Update usage of getTitleSnippet(), getRedirectSnippet() and getSectionSnippet()"
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 3407476..8ff4097 100644 (file)
@@ -197,14 +197,6 @@ class SpecialSearch extends SpecialPage {
                $title = Title::newFromText( $term );
                if ( !is_null( $title ) ) {
                        wfRunHooks( 'SpecialSearchNogomatch', array( &$title ) );
-                       wfDebugLog( 'nogomatch', $title->getFullText(), 'private' );
-
-                       # If the feature is enabled, go straight to the edit page
-                       if ( $this->getConfig()->get( 'GoToEdit' ) ) {
-                               $this->getOutput()->redirect( $title->getFullURL( array( 'action' => 'edit' ) ) );
-
-                               return;
-                       }
                }
                $this->showResults( $term );
        }
@@ -591,7 +583,7 @@ class SpecialSearch extends SpecialPage {
 
                $title = $result->getTitle();
 
-               $titleSnippet = $result->getTitleSnippet( $terms );
+               $titleSnippet = $result->getTitleSnippet();
 
                if ( $titleSnippet == '' ) {
                        $titleSnippet = null;
@@ -673,26 +665,6 @@ class SpecialSearch extends SpecialPage {
 
                $date = $lang->userTimeAndDate( $timestamp, $this->getUser() );
 
-               // link to related articles if supported
-               $related = '';
-               if ( $result->hasRelated() ) {
-                       $stParams = array_merge(
-                               $this->powerSearchOptions(),
-                               array(
-                                       'search' => $this->msg( 'searchrelated' )->inContentLanguage()->text() .
-                                               ':' . $title->getPrefixedText(),
-                                       'fulltext' => $this->msg( 'search' )->text()
-                               )
-                       );
-
-                       $related = ' -- ' . Linker::linkKnown(
-                               $this->getPageTitle(),
-                               $this->msg( 'search-relatedarticle' )->text(),
-                               array(),
-                               $stParams
-                       );
-               }
-
                $fileMatch = '';
                // Include a thumbnail for media files...
                if ( $title->getNamespace() == NS_FILE ) {
@@ -718,7 +690,7 @@ class SpecialSearch extends SpecialPage {
                                                '<td style="vertical-align: top;">' .
                                                "{$link} {$redirect} {$section} {$fileMatch}" .
                                                $extract .
-                                               "<div class='mw-search-result-data'>{$desc} - {$date}{$related}</div>" .
+                                               "<div class='mw-search-result-data'>{$desc} - {$date}</div>" .
                                                '</td>' .
                                                '</tr>' .
                                                '</table>' .
@@ -738,7 +710,7 @@ class SpecialSearch extends SpecialPage {
                ) ) ) {
                        $html = "<li><div class='mw-search-result-heading'>" .
                                "{$link} {$redirect} {$section} {$fileMatch}</div> {$extract}\n" .
-                               "<div class='mw-search-result-data'>{$size} - {$date}{$related}</div>" .
+                               "<div class='mw-search-result-data'>{$size} - {$date}</div>" .
                                "</li>\n";
                }
 
@@ -1088,16 +1060,15 @@ class SpecialSearch extends SpecialPage {
                        'class' => 'mw-ui-input mw-ui-input-inline',
                ) ) . "\n";
                $out .= Html::hidden( 'fulltext', 'Search' ) . "\n";
-               $out .= Xml::submitButton(
+               $out .= Html::submitButton(
                        $this->msg( 'searchbutton' )->text(),
-                       array( 'class' => array( 'mw-ui-button', 'mw-ui-progressive' ) )
+                       array(), array( 'mw-ui-progressive' )
                ) . "\n";
 
                // Results-info
                if ( $totalNum > 0 && $this->offset < $totalNum ) {
-                       $top = $this->msg( 'showingresultsheader' )
+                       $top = $this->msg( 'search-showingresults' )
                                ->numParams( $this->offset + 1, $this->offset + $resultsShown, $totalNum )
-                               ->params( wfEscapeWikiText( $term ) )
                                ->numParams( $resultsShown )
                                ->parse();
                        $out .= Xml::tags( 'div', array( 'class' => 'results-info' ), $top ) .