From 5c70d85ca9664cbddba2ebf7996c3fb84ee018a8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 25 Oct 2008 00:25:51 +0000 Subject: [PATCH] Back out r42352, r42355, r42363, r42410 for now "Redesigning Special:Search" It's still very awkward, with weird error messages, some styling issues, and generally needs a lot of polish. Not ready to go live. --- includes/DefaultSettings.php | 15 -- includes/SearchEngine.php | 63 +------ includes/specials/SpecialPreferences.php | 11 +- includes/specials/SpecialSearch.php | 225 ++++------------------- languages/messages/MessagesEn.php | 99 +++++----- maintenance/language/messages.inc | 9 +- skins/common/shared.css | 5 - skins/monobook/main.css | 4 - 8 files changed, 94 insertions(+), 337 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3278219ea2..6607e4d37c 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1865,25 +1865,10 @@ $wgNamespacesWithSubpages = array( NS_CATEGORY_TALK => true ); -/** Default search for anonymous users */ $wgNamespacesToBeSearchedDefault = array( NS_MAIN => true, ); -/** - * Additional namespaces to those in $wgNamespacesToBeSearchedDefault that - * will be added to default search for logged-in users. - * - * Same format as $wgNamespacesToBeSearchedDefault - */ -$wgNamespacesToBeSearchedProject = array( - NS_USER => true, - NS_PROJECT => true, - NS_HELP => true, - NS_CATEGORY => true, -); - - /** * Site notice shown at the top of each page * diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 6b77bb0103..1856b9e57a 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -43,11 +43,6 @@ class SearchEngine { return null; } - /** If this search backend can list/unlist redirects */ - function acceptListRedirects() { - return true; - } - /** * If an exact title match can be find, or a very slightly close match, * return the title. If no match, returns NULL. @@ -233,10 +228,6 @@ class SearchEngine { */ public static function userNamespaces( &$user ) { $arr = array(); - // for logged-in users use predefined defaults - if( $user->isLoggedIn() && $user->getOption( 'defaultusersearch', true ) ) - return SearchEngine::projectNamespaces(); - foreach( SearchEngine::searchableNamespaces() as $ns => $name ) { if( $user->getOption( 'searchNs' . $ns ) ) { $arr[] = $ns; @@ -271,38 +262,7 @@ class SearchEngine { return array_keys($wgNamespacesToBeSearchedDefault, true); } - - /** - * Get a list of namespace names useful for showing in tooltips - * and preferences - * - * @param unknown_type $namespaces - */ - public static function namespacesAsText( $namespaces ){ - global $wgContLang; - - $formatted = array_map( array($wgContLang,'getFormattedNsText'), $namespaces ); - foreach( $formatted as $key => $ns ){ - if ( empty($ns) ) - $formatted[$key] = wfMsg( 'blanknamespace' ); - } - return $formatted; - } - - /** - * An array of "project" namespaces indexes typically searched - * by logged-in users - * - * @return array - * @static - */ - public static function projectNamespaces(){ - global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject; - - return array_keys( $wgNamespacesToBeSearchedDefault + - $wgNamespacesToBeSearchedProject, true); - } - + /** * Return a 'cleaned up' search string * @@ -387,7 +347,6 @@ class SearchEngine { else return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}'; } - } /** @@ -524,17 +483,11 @@ class SearchResultTooMany { */ class SearchResult { var $mRevision = null; - var $mImage = null; function SearchResult( $row ) { $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title ); - if( !is_null($this->mTitle) ){ + if( !is_null($this->mTitle) ) $this->mRevision = Revision::newFromTitle( $this->mTitle ); - if($this->mTitle->getNamespace() == NS_IMAGE) - $this->mImage = wfFindFile( $this->mTitle ); - } - - } /** @@ -556,7 +509,7 @@ class SearchResult { * @access public */ function isMissingRevision(){ - if( !$this->mRevision && !$this->mImage ) + if( !$this->mRevision ) return true; return false; } @@ -581,10 +534,7 @@ class SearchResult { */ protected function initText(){ if( !isset($this->mText) ){ - if($this->mRevision != null) - $this->mText = $this->mRevision->getText(); - else - $this->mText = ''; + $this->mText = $this->mRevision->getText(); } } @@ -644,10 +594,7 @@ class SearchResult { * @return string timestamp */ function getTimestamp(){ - if($this->mRevision != null) - return $this->mRevision->getTimestamp(); - else - return ''; + return $this->mRevision->getTimestamp(); } /** diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 9e43055d42..b18a9fa0b9 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -67,7 +67,6 @@ class PreferencesForm { $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' ); $this->mWatchlistEdits = $request->getVal( 'wpWatchlistEdits' ); $this->mDisableMWSuggest = $request->getCheck( 'wpDisableMWSuggest' ); - $this->mDefaultUserSearch = $request->getVal( 'wpUserSearch' ) != 'wpCustomUserSearch'; $this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) && $this->mPosted && @@ -290,7 +289,6 @@ class PreferencesForm { $wgUser->setOption( 'underline', $this->validateInt($this->mUnderline, 0, 2) ); $wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays, 0, 7 ) ); $wgUser->setOption( 'disablesuggest', $this->mDisableMWSuggest ); - $wgUser->setOption( 'defaultusersearch', $this->mDefaultUserSearch ); # Set search namespace options foreach( $this->mSearchNs as $i => $value ) { @@ -505,7 +503,7 @@ class PreferencesForm { return Xml::tags( 'tr', null, $td1 . $td2 ). $td3 . "\n"; } - + /** * @access private */ @@ -1050,16 +1048,11 @@ class PreferencesForm { $wgOut->addHtml( '' ); # Search - $defaultNs = SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() ); $mwsuggest = $wgEnableMWSuggest ? $this->addRow( Xml::label( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ), Xml::check( 'wpDisableMWSuggest', $this->mDisableMWSuggest, array( 'id' => 'wpDisableMWSuggest' ) ) ) : ''; - $userDefaultSearch = '

'.Xml::radioLabel(wfMsg('prefs-search-nsdefault'),'wpUserSearch','wpDefaultUserSearch','wpDefaultUserSearch',$this->mDefaultUserSearch). - '

'.implode(', ', $defaultNs).'

'. - Xml::radioLabel(wfMsg('prefs-search-nscustom'),'wpUserSearch','wpCustomUserSearch','wpCustomUserSearch',!$this->mDefaultUserSearch). - '

'; $wgOut->addHTML( // Elements for the search tab itself Xml::openElement( 'fieldset' ) . @@ -1086,7 +1079,7 @@ class PreferencesForm { // Elements for the namespace options in the search tab Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'prefs-namespaces' ) ) . - $userDefaultSearch. + wfMsgExt( 'defaultns', array( 'parse' ) ) . $ps . Xml::closeElement( 'fieldset' ) . // End of the search tab diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 3b4bda2cb4..3ee0bf11fa 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -69,7 +69,6 @@ class SpecialSearch { } $this->searchRedirects = $request->getcheck( 'redirs' ) ? true : false; - $this->searchAdvanced = $request->getVal('advanced'); } /** @@ -109,6 +108,13 @@ class SpecialSearch { } } + $wgOut->wrapWikiMsg( "==$1==\n", 'notitlematches' ); + if( $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) { + $wgOut->addWikiMsg( 'noexactmatch', wfEscapeWikiText( $term ) ); + } else { + $wgOut->addWikiMsg( 'noexactmatch-nocreate', wfEscapeWikiText( $term ) ); + } + return $this->showResults( $term ); } @@ -123,56 +129,14 @@ class SpecialSearch { $sk = $wgUser->getSkin(); $this->setupPage( $term ); - $this->searchEngine = SearchEngine::create(); - - $t = Title::newFromText( $term ); - - // add a table since it's difficult to stack divs horizontally nicely - // left - search box, right - search menu - - $wgOut->addHtml( - Xml::openElement( 'table', array( 'border'=>'0' ) ). - Xml::openElement( 'tr' ) . - Xml::openElement( 'td' ) . "\n" - ); - - - if( $this->searchAdvanced ){ - $wgOut->addHTML( $this->powerSearchBox( $term ) ); - $showMenu = false; - } else { - $wgOut->addHTML( $this->shortDialog( $term ) ); - $showMenu = true; - } - - $wgOut->addHtml( Xml::closeElement( 'td' ) ); - - - $wgOut->addHtml( Xml::openElement('td', array( 'id' => 'mw-search-menu' )) ); - - if( $showMenu ){ - if( $t!=null && $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) { - if( $t->exists() ){ - $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $term ) ); - } else { - $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $term ) ); - } - } - } - if ( is_null($t) ) - $wgOut->addWikiMsg( 'searchmenu-badtitle', wfEscapeWikiText( $term ) ); - else - $wgOut->addWikiMsg( 'searchmenu', wfEscapeWikiText( $term ) ); - - $wgOut->addHtml( - Xml::closeElement('td'). - Xml::closeElement('tr'). - Xml::closeElement('table') - ); - + + $wgOut->addWikiMsg( 'searchresulttext' ); if( '' === trim( $term ) ) { // Empty query -- straight view of search form + $wgOut->setSubtitle( '' ); + $wgOut->addHTML( $this->powerSearchBox( $term ) ); + $wgOut->addHTML( $this->powerSearchFocus() ); wfProfileOut( $fname ); return; } @@ -201,7 +165,9 @@ class SpecialSearch { return; } - $search = $this->searchEngine; + $wgOut->addHTML( $this->shortDialog( $term ) ); + + $search = SearchEngine::create(); $search->setLimitOffset( $this->limit, $this->offset ); $search->setNamespaces( $this->namespaces ); $search->showRedirects = $this->searchRedirects; @@ -212,13 +178,14 @@ class SpecialSearch { // Sometimes the search engine knows there are too many hits if ($titleMatches instanceof SearchResultTooMany) { $wgOut->addWikiText( '==' . wfMsg( 'toomanymatches' ) . "==\n" ); + $wgOut->addHTML( $this->powerSearchBox( $term ) ); + $wgOut->addHTML( $this->powerSearchFocus() ); wfProfileOut( $fname ); return; } $textMatches = $search->searchText( $rewritten ); - - + // did you mean... suggestions if($textMatches && $textMatches->hasSuggestion()){ $st = SpecialPage::getTitleFor( 'Search' ); @@ -231,8 +198,8 @@ class SpecialSearch { $textMatches->getSuggestionSnippet().''; $wgOut->addHTML('
'.wfMsg('search-suggest',$suggestLink).'
'); - } - + } + // show number of results $num = ( $titleMatches ? $titleMatches->numRows() : 0 ) + ( $textMatches ? $textMatches->numRows() : 0); @@ -297,11 +264,12 @@ class SpecialSearch { } if ( $num == 0 ) { - $wgOut->addWikiMsg( 'search-nonefound' ); + $wgOut->addWikiMsg( 'nonefound' ); } if( $num || $this->offset ) { $wgOut->addHTML( "

{$prevnext}

\n" ); } + $wgOut->addHTML( $this->powerSearchBox( $term ) ); wfProfileOut( $fname ); } @@ -317,6 +285,8 @@ class SpecialSearch { $wgOut->setPageTitle( wfMsg( 'searchresults') ); $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'searchresults-title', $term) ) ); } + $subtitlemsg = ( Title::newFromText( $term ) ? 'searchsubtitle' : 'searchsubtitleinvalid' ); + $wgOut->setSubtitle( $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ) ); $wgOut->setArticleRelated( false ); $wgOut->setRobotPolicy( 'noindex,nofollow' ); } @@ -350,8 +320,6 @@ class SpecialSearch { $opt['ns' . $n] = 1; } $opt['redirs'] = $this->searchRedirects ? 1 : 0; - if( $this->searchAdvanced ) - $opt['advanced'] = $this->searchAdvanced; return $opt; } @@ -631,18 +599,14 @@ class SpecialSearch { Xml::closeElement( 'span' ) . "\n"; } - if( $this->searchEngine->acceptListRedirects() ){ - $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1', 'id' => 'redirs' ) ); - $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' ); - } else{ - $redirect = ''; - $redirectLabel = ''; - } + $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1', 'id' => 'redirs' ) ); + $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' ); $searchField = Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'powerSearchText' ) ); $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'fulltext' ) ) . "\n"; $searchTitle = SpecialPage::getTitleFor( 'Search' ); $out = Xml::openElement( 'form', array( 'id' => 'powersearch', 'method' => 'get', 'action' => $wgScript ) ) . + Xml::fieldset( wfMsg( 'powersearch-legend' ), Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "

" . wfMsgExt( 'powersearch-ns', array( 'parseinline' ) ) . @@ -656,11 +620,10 @@ class SpecialSearch { " " . $searchField . " " . - $searchButton. + $searchButton ) . ""; - return Xml::openElement( 'fieldset', array( 'id' => 'mw-searchoptions' ) ) . $this->formHeader($term) . - $out . Xml::closeElement( 'fieldset' ); + return $out; } function powerSearchFocus() { @@ -671,134 +634,18 @@ class SpecialSearch { "});" . ""; } - - /** Make a search link with some target namespaces */ - function makeSearchLink($term, $namespaces, $label, $tooltip, $params=array()){ - $opt = $params; - foreach( $namespaces as $n ) { - $opt['ns' . $n] = 1; - } - $opt['redirs'] = $this->searchRedirects ? 1 : 0; - - $st = SpecialPage::getTitleFor( 'Search' ); - $stParams = wfArrayToCGI( array( - 'search' => $term, - 'fulltext' => wfMsg( 'search' ) ), - $opt); - - return Xml::element( 'a', - array( 'href'=> $st->getLocalURL( $stParams ), 'title' => $tooltip ), - $label ); - - } - - /** Check if query starts with image: prefix */ - function startsWithImage( $term ){ - global $wgContLang; - - $p = explode( ':', $term ); - if( count( $p ) > 1 ){ - return $wgContLang->getNsIndex( $p[0] ) == NS_IMAGE; - } - return false; - } - - /** Check if query begins with all: magic prefix */ - function startsWithAll($term){ - global $wgContLang; - - $p = explode( ':', $term ); - return count( $p ) > 1 && $p[0] == wfMsg( 'searchall' ); - } - function formHeader( $term ) { - global $wgContLang; - - $sep = '   '; - $out = Xml::openElement('div', array( 'style' => 'padding-bottom:0.5em;' ) ); - - $bareterm = $term; - if( $this->startsWithAll( $term ) || $this->startsWithImage( $term ) ) - $bareterm = substr( $term, strpos( $term, ':' ) + 1 ); // delete all/image prefix - - // figure out the active search profile header - if( $this->searchAdvanced ) - $active = 'advanced'; - else if( $this->namespaces == NS_IMAGE || $this->startsWithImage( $term ) ) - $active = 'images'; - elseif( $this->startsWithAll( $term ) ) - $active = 'all'; - elseif( $this->namespaces == SearchEngine::defaultNamespaces() ) - $active = 'default'; - elseif( $this->namespaces == SearchEngine::projectNamespaces() ) - $active = 'project'; - else - $active = 'advanced'; - - - // search profiles headers - $m = wfMsg( 'searchprofile-articles' ); - $tt = wfMsg( 'searchprofile-articles-tooltip', - implode( ', ', SearchEngine::namespacesAsText( SearchEngine::defaultNamespaces() ) ) ); - if( $active == 'default' ){ - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m ); - } else - $out .= $this->makeSearchLink( $bareterm, SearchEngine::defaultNamespaces(), $m, $tt ); - - $out .= $sep; - - $m = wfMsg( 'searchprofile-project' ); - $tt = wfMsg( 'searchprofile-project-tooltip', - implode( ', ', SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() ) ) ); - if( $active == 'project' ){ - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m ); - } else - $out .= $this->makeSearchLink( $bareterm, SearchEngine::projectNamespaces(), $m, $tt ); - - $out .= $sep; - - $m = wfMsg( 'searchprofile-images' ); - $tt = wfMsg( 'searchprofile-images-tooltip' ); - if( $active == 'images' ){ - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m ); - } else - $out .= $this->makeSearchLink( $wgContLang->getFormattedNsText(NS_IMAGE).':'.$bareterm, array() , $m, $tt ); - - $out .= $sep; - - $m = wfMsg( 'searchprofile-everything' ); - $tt = wfMsg( 'searchprofile-everything-tooltip' ); - if( $active == 'all' ){ - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m ); - } else - $out .= $this->makeSearchLink( wfMsg( 'searchall' ).':'.$bareterm, array() , $m, $tt ); - - $out .= $sep; - - $m = wfMsg( 'searchprofile-advanced' ); - $tt = wfMsg( 'searchprofile-advanced-tooltip' ); - if( $active == 'advanced' ){ - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m ); - } else - $out .= $this->makeSearchLink( $bareterm, array() , $m, $tt, array( 'advanced' => '1' ) ); - - $out .= Xml::closeElement('div') ; - - return $out; - } - - function shortDialog( $term ) { + function shortDialog($term) { global $wgScript; - - $out = Xml::openElement( 'form', array( + + $out = Xml::openElement( 'form', array( 'id' => 'search', 'method' => 'get', 'action' => $wgScript )); $searchTitle = SpecialPage::getTitleFor( 'Search' ); - $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n"; - $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . "\n"; - + $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ); + $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . ' '; foreach( SearchEngine::searchableNamespaces() as $ns => $name ) { if( in_array( $ns, $this->namespaces ) ) { $out .= Xml::hidden( "ns{$ns}", '1' ); @@ -806,7 +653,7 @@ class SpecialSearch { } $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) ); $out .= Xml::closeElement( 'form' ); - return Xml::openElement( 'fieldset', array( 'id' => 'mw-searchoptions' ) ) . $this->formHeader($term) . - $out . Xml::closeElement( 'fieldset' ); + + return $out; } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 39fb8c2cc8..31449398da 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1415,61 +1415,49 @@ Note that using the navigation links will reset this column.', 'diff-strike' => "'''strikethrough'''", # Search results -'searchresults' => 'Search results', -'searchresults-title' => 'Search results for $1', -'toomanymatches' => 'Too many matches were returned, please try a different query', -'titlematches' => 'Page title matches', -'notitlematches' => 'No page title matches', -'textmatches' => 'Page text matches', -'notextmatches' => 'No page text matches', -'prevn' => 'previous $1', -'nextn' => 'next $1', -'viewprevnext' => 'View ($1) ($2) ($3)', -'searchmenu-exists' => "* Page '''[[$1]]'''", -'searchmenu-new' => "* Create page '''[[$1]]'''", -'searchhelp-url' => 'Project:Searching', -'searchmenu-badtitle' => '* "$1" is not a valid title. -* [[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]', -'searchmenu' => '* [[Special:AllPages/$1|Index]] -* [[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]', -'searchprofile-articles' => 'Pages', -'searchprofile-project' => 'Pages/Project', -'searchprofile-images' => 'Files', -'searchprofile-everything' => 'Everything', -'searchprofile-advanced' => 'Advanced', -'searchprofile-articles-tooltip' => 'Search in $1', -'searchprofile-project-tooltip' => 'Search in $1', -'searchprofile-images-tooltip' => 'Search for files', -'searchprofile-everything-tooltip' => 'Search all of content (including talk pages)', -'searchprofile-advanced-tooltip' => 'Search in custom namespaces', -'prefs-search-nsdefault' => 'Search using defaults:', -'prefs-search-nscustom' => 'Search custom namespaces:', -'search-result-size' => '$1 ({{PLURAL:$2|1 word|$2 words}})', -'search-result-score' => 'Relevance: $1%', -'search-redirect' => '(redirect $1)', -'search-section' => '(section $1)', -'search-suggest' => 'Did you mean: $1', -'search-interwiki-caption' => 'Sister projects', -'search-interwiki-default' => '$1 results:', -'search-interwiki-custom' => '', # do not translate or duplicate this message to other languages -'search-interwiki-more' => '(more)', -'search-mwsuggest-enabled' => 'with suggestions', -'search-mwsuggest-disabled' => 'no suggestions', -'search-relatedarticle' => 'Related', -'mwsuggest-disable' => 'Disable AJAX suggestions', -'searchrelated' => 'related', -'searchall' => 'all', -'showingresults' => "Showing below up to {{PLURAL:$1|'''1''' result|'''$1''' results}} starting with #'''$2'''.", -'showingresultsnum' => "Showing below {{PLURAL:$3|'''1''' result|'''$3''' results}} starting with #'''$2'''.", -'showingresultstotal' => "Showing below {{PLURAL:$4|result '''$1''' of '''$3'''|results '''$1 - $2''' of '''$3'''}}", -'search-nonefound' => 'There were no results matching the query.', -'powersearch' => 'Advanced search', -'powersearch-legend' => 'Advanced search', -'powersearch-ns' => 'Search in namespaces:', -'powersearch-redir' => 'List redirects', -'powersearch-field' => 'Search for', -'search-external' => 'External search', -'searchdisabled' => '{{SITENAME}} search is disabled. +'searchresults' => 'Search results', +'searchresults-title' => 'Search results for $1', +'searchresulttext' => 'For more information about searching {{SITENAME}}, see [[{{MediaWiki:Helppage}}|{{int:help}}]].', +'searchsubtitle' => 'You searched for \'\'\'[[:$1]]\'\'\' ([[Special:Prefixindex/$1|all pages starting with "$1"]] | [[Special:WhatLinksHere/$1|all pages that link to "$1"]])', +'searchsubtitleinvalid' => "You searched for '''$1'''", +'noexactmatch' => "'''There is no page titled \"\$1\".''' +You can [[:\$1|create this page]].", +'noexactmatch-nocreate' => "'''There is no page titled \"\$1\".'''", +'toomanymatches' => 'Too many matches were returned, please try a different query', +'titlematches' => 'Page title matches', +'notitlematches' => 'No page title matches', +'textmatches' => 'Page text matches', +'notextmatches' => 'No page text matches', +'prevn' => 'previous $1', +'nextn' => 'next $1', +'viewprevnext' => 'View ($1) ($2) ($3)', +'search-result-size' => '$1 ({{PLURAL:$2|1 word|$2 words}})', +'search-result-score' => 'Relevance: $1%', +'search-redirect' => '(redirect $1)', +'search-section' => '(section $1)', +'search-suggest' => 'Did you mean: $1', +'search-interwiki-caption' => 'Sister projects', +'search-interwiki-default' => '$1 results:', +'search-interwiki-custom' => '', # do not translate or duplicate this message to other languages +'search-interwiki-more' => '(more)', +'search-mwsuggest-enabled' => 'with suggestions', +'search-mwsuggest-disabled' => 'no suggestions', +'search-relatedarticle' => 'Related', +'mwsuggest-disable' => 'Disable AJAX suggestions', +'searchrelated' => 'related', +'searchall' => 'all', +'showingresults' => "Showing below up to {{PLURAL:$1|'''1''' result|'''$1''' results}} starting with #'''$2'''.", +'showingresultsnum' => "Showing below {{PLURAL:$3|'''1''' result|'''$3''' results}} starting with #'''$2'''.", +'showingresultstotal' => "Showing below {{PLURAL:$4|result '''$1''' of '''$3'''|results '''$1 - $2''' of '''$3'''}}", +'nonefound' => "'''Note''': Only some namespaces are searched by default. +Try prefixing your query with ''all:'' to search all content (including talk pages, templates, etc), or use the desired namespace as prefix.", +'powersearch' => 'Advanced search', +'powersearch-legend' => 'Advanced search', +'powersearch-ns' => 'Search in namespaces:', +'powersearch-redir' => 'List redirects', +'powersearch-field' => 'Search for', +'search-external' => 'External search', +'searchdisabled' => '{{SITENAME}} search is disabled. You can search via Google in the meantime. Note that their indexes of {{SITENAME}} content may be out of date.', 'googlesearch' => '

@@ -1552,6 +1540,7 @@ please see math/README to configure.', 'allowemail' => 'Enable e-mail from other users', 'prefs-searchoptions' => 'Search options', 'prefs-namespaces' => 'Namespaces', +'defaultns' => 'Search in these namespaces by default:', 'default' => 'default', 'files' => 'Files', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 4588981ec9..29c3677051 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -757,6 +757,11 @@ $wgMessageStructure = array( 'search' => array( 'searchresults', 'searchresults-title', + 'searchresulttext', + 'searchsubtitle', + 'searchsubtitleinvalid', + 'noexactmatch', + 'noexactmatch-nocreate', 'toomanymatches', 'titlematches', 'notitlematches', @@ -768,7 +773,6 @@ $wgMessageStructure = array( 'searchmenu-exists', 'searchmenu-new', 'searchhelp-url', - 'searchmenu-badtitle', 'searchmenu', 'searchprofile-articles', 'searchprofile-project', @@ -800,7 +804,7 @@ $wgMessageStructure = array( 'showingresults', 'showingresultsnum', 'showingresultstotal', - 'search-nonefound', + 'nonefound', 'powersearch', 'powersearch-legend', 'powersearch-ns', @@ -874,6 +878,7 @@ $wgMessageStructure = array( 'allowemail', 'prefs-searchoptions', 'prefs-namespaces', + 'defaultns', 'default', 'files', ), diff --git a/skins/common/shared.css b/skins/common/shared.css index c1b4129c98..b6020d81b5 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -112,11 +112,6 @@ div.searchresult { font-size: 97%; } -td#mw-search-menu { - padding-left:6em; - font-size:85%; -} - div#mw-search-interwiki { float: right; width: 18em; diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 1824fa59be..170dae4911 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1409,10 +1409,6 @@ div#searchTargetHide { padding:2px; } -#powersearch p { - margin-top:0px; -} - div.multipageimagenavbox { border: solid 1px silver; padding: 4px; -- 2.20.1