diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index bd71fc55997..53cc822f9da 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1976,16 +1976,14 @@ $wgNamespacesToBeSearchedDefault = array( ); /** - * Additional namespaces to those in $wgNamespacesToBeSearchedDefault that - * will be added to default search for "project" page inclusive searches + * Namespaces to be searched when user clicks the "Help" tab + * on Special:Search * * Same format as $wgNamespacesToBeSearchedDefault */ -$wgNamespacesToBeSearchedProject = array( - NS_USER => true, +$wgNamespacesToBeSearchedHelp = array( NS_PROJECT => true, NS_HELP => true, - NS_CATEGORY => true, ); $wgUseOldSearchUI = true; // temp testing variable diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 86822d89f32..3a4dacaf8b5 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -292,28 +292,14 @@ class SearchEngine { } /** - * An array of "project" namespaces indexes typically searched - * by logged-in users + * Return the help namespaces to be shown on Special:Search * * @return Array */ - public static function projectNamespaces() { - global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject; + public static function helpNamespaces() { + global $wgNamespacesToBeSearchedHelp; - return array_keys( $wgNamespacesToBeSearchedProject, true ); - } - - /** - * An array of "project" namespaces indexes typically searched - * by logged-in users in addition to the default namespaces - * - * @return Array - */ - public static function defaultAndProjectNamespaces() { - global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject; - - return array_keys( $wgNamespacesToBeSearchedDefault + - $wgNamespacesToBeSearchedProject, true); + return array_keys( $wgNamespacesToBeSearchedHelp, true ); } /** diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 477d818fd22..d842465105c 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -206,14 +206,6 @@ class SpecialSearch { return; } - // 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() ) ); - } - } // Get number of results $titleMatchesSQL = $titleMatches ? $titleMatches->numRows() : 0; @@ -228,16 +220,17 @@ class SpecialSearch { $totalRes = $numTitleMatches + $numTextMatches; // show number of results and current offset - if( $numSQL > 0 ) { - if( $numSQL > 0 ) { - $top = wfMsgExt('showingresultstotal', array( 'parseinline' ), - $this->offset+1, $this->offset+$numSQL, $totalRes, $numSQL ); - } elseif( $numSQL >= $this->limit ) { - $top = wfShowingResults( $this->offset, $this->limit ); + $wgOut->addHTML( $this->formHeader($term, $numSQL, $totalRes)); + + $wgOut->addHtml( "
{$top}
\n" ); } // prev/next links @@ -247,13 +240,13 @@ class SpecialSearch { wfArrayToCGI( $this->powerSearchOptions(), array( 'search' => $term ) ), max( $titleMatchesSQL, $textMatchesSQL ) < $this->limit ); - $wgOut->addHTML( "{$prevnext}
\n" ); + //$wgOut->addHTML( "{$prevnext}
\n" ); wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) ); } else { wfRunHooks( 'SpecialSearchNoResults', array( $term ) ); - } + } - $wgOut->addHtml( "{$countHtml}
\n" ; + } else{ + $out .= "\n"; + } + + $out .= Xml::closeElement('div') ; return $out; } @@ -762,17 +765,14 @@ class SpecialSearch { $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . "\n"; $out .= Xml::hidden( 'fulltext', 'Search' ); $out .= Xml::submitButton( wfMsg( 'searchbutton' ) ); - $out .= ' (' . wfMsgExt('searchmenu-help',array('parseinline') ) . ')'; + //$out .= ' (' . wfMsgExt('searchmenu-help',array('parseinline') ) . ')'; $out .= Xml::closeElement( 'form' ); // Add prefix link for single-namespace searches $t = Title::newFromText( $term ); /*if( $t != null && count($this->namespaces) === 1 ) { $out .= wfMsgExt( 'searchmenu-prefix', array('parseinline'), $term ); }*/ - return Xml::openElement( 'fieldset', array('id' => 'mw-searchoptions','style' => 'margin:0em;') ) . - Xml::element( 'legend', null, wfMsg('searchmenu-legend') ) . - $this->formHeader($term) . $out . $this->didYouMeanHtml . - Xml::closeElement( 'fieldset' ); + return $out . $this->didYouMeanHtml; } /** Make a search link with some target namespaces */ @@ -801,6 +801,18 @@ class SpecialSearch { } return false; } + + /** Check if query starts with all: prefix */ + protected function startsWithAll( $term ) { + + $allkeyword = wfMsgForContent('searchall'); + + $p = explode( ':', $term ); + if( count( $p ) > 1 ) { + return $p[0] == $allkeyword; + } + return false; + } protected function namespaceTables( $namespaces, $rowsPerTable = 3 ) { global $wgContLang; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 9ff7898a75e..6ea5c2de379 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1450,9 +1450,9 @@ You can [[:\$1|create this page]].", 'searchhelp-url' => 'Help:Contents', 'searchmenu-prefix' => '[[Special:PrefixIndex/$1|Browse pages with this prefix]]', 'searchmenu-help' => '[[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]?', # do not translate or duplicate this message to other languages -'searchprofile-articles' => 'Content pages', -'searchprofile-project' => 'Project pages', -'searchprofile-images' => 'Files', +'searchprofile-articles' => 'Articles', +'searchprofile-project' => 'Help', +'searchprofile-images' => 'Multimedia', 'searchprofile-everything' => 'Everything', 'searchprofile-advanced' => 'Advanced', 'searchprofile-articles-tooltip' => 'Search in $1', @@ -1478,6 +1478,7 @@ You can [[:\$1|create this page]].", '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'''}}", +'showingresultsheader' => "{{PLURAL:$5|Result '''$1''' of '''$3'''|Results '''$1 - $2''' of '''$3'''}} for '''$4'''", '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.", 'search-nonefound' => 'There were no results matching the query.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 626604edf5d..a594c23e53f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -812,6 +812,7 @@ $wgMessageStructure = array( 'showingresults', 'showingresultsnum', 'showingresultstotal', + 'showingresultsheader', 'nonefound', 'search-nonefound', 'powersearch', diff --git a/skins/common/shared.css b/skins/common/shared.css index d9396662663..8872ef8b7ef 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -102,19 +102,55 @@ p.mw-filedelete-editreasons, p.mw-delete-editreasons { } /* Search results */ +.searchresults { +} + +.searchresults p { + margin-left: 0.4em; + margin-top: 1em; + margin-bottom: 1.2em; +} + div.searchresult { font-size: 95%; - width:38em; + width:38em; } + +.mw-search-results { + margin-left: 0.4em; +} + .mw-search-results li { padding-bottom: 1em; list-style:none; } +.mw-search-results li a { + font-size: 108%; +} + .mw-search-result-data { color: green; font-size: 97%; } +.mw-search-formheader { + background-color:#ECECEC; + margin:1em 0pt; + padding:0.02em ; + border-top:1px solid #BBBBBB; +} + +.mw-search-formheader div { + float:left; + padding:4px 0.5em 0px 4px; +} + +.mw-search-formheader p { + margin:0.1em 0pt; + padding:0.2em 0.4em 0.2em 0.2em; + text-align:right; +} + td#mw-search-menu { padding-left:6em; font-size:85%; @@ -138,6 +174,24 @@ div#mw-search-interwiki li { font-size: 90%; } +div#mw-search-interwiki-caption { + text-align: center; + font-weight: bold; + font-size: 95%; +} + +.mw-search-interwiki-project { + font-size: 97%; + text-align: left; + padding-left: 0.2em; + padding-right: 0.15em; + padding-bottom: 0.2em; + padding-top: 0.15em; + background-color:#ececec; + border-top:1px solid #BBBBBB; +} + + span.searchalttitle { font-size: 95%; } @@ -158,13 +212,6 @@ div.searchdidyoumean em { font-weight: bold; } -div.searchresults { - border:1px solid darkblue; - padding-top: 10px; - padding-bottom: 10px; - padding-left: 20px; - padding-right: 20px; -} /* * UserRights stuff diff --git a/skins/monobook/main.css b/skins/monobook/main.css index cf93ebffca3..a8213e949fd 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1542,23 +1542,6 @@ div.mw-lag-warn-high { font-size: 90%; } -/** Special:Search stuff */ -div#mw-search-interwiki-caption { - text-align: center; - font-weight: bold; - font-size: 95%; -} - -.mw-search-interwiki-project { - font-size: 97%; - text-align: left; - padding-left: 0.2em; - padding-right: 0.15em; - padding-bottom: 0.2em; - padding-top: 0.15em; - background: #cae8ff; -} - /* God-damned hack for the crappy layout */ .os-suggest { font-size: 127%;