r42522 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42521‎ | r42522 | r42523 >
Date:00:25, 25 October 2008
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SearchEngine.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -757,6 +757,11 @@
758758 'search' => array(
759759 'searchresults',
760760 'searchresults-title',
 761+ 'searchresulttext',
 762+ 'searchsubtitle',
 763+ 'searchsubtitleinvalid',
 764+ 'noexactmatch',
 765+ 'noexactmatch-nocreate',
761766 'toomanymatches',
762767 'titlematches',
763768 'notitlematches',
@@ -768,7 +773,6 @@
769774 'searchmenu-exists',
770775 'searchmenu-new',
771776 'searchhelp-url',
772 - 'searchmenu-badtitle',
773777 'searchmenu',
774778 'searchprofile-articles',
775779 'searchprofile-project',
@@ -800,7 +804,7 @@
801805 'showingresults',
802806 'showingresultsnum',
803807 'showingresultstotal',
804 - 'search-nonefound',
 808+ 'nonefound',
805809 'powersearch',
806810 'powersearch-legend',
807811 'powersearch-ns',
@@ -874,6 +878,7 @@
875879 'allowemail',
876880 'prefs-searchoptions',
877881 'prefs-namespaces',
 882+ 'defaultns',
878883 'default',
879884 'files',
880885 ),
Index: trunk/phase3/skins/monobook/main.css
@@ -1409,10 +1409,6 @@
14101410 padding:2px;
14111411 }
14121412
1413 -#powersearch p {
1414 - margin-top:0px;
1415 -}
1416 -
14171413 div.multipageimagenavbox {
14181414 border: solid 1px silver;
14191415 padding: 4px;
Index: trunk/phase3/skins/common/shared.css
@@ -112,11 +112,6 @@
113113 font-size: 97%;
114114 }
115115
116 -td#mw-search-menu {
117 - padding-left:6em;
118 - font-size:85%;
119 -}
120 -
121116 div#mw-search-interwiki {
122117 float: right;
123118 width: 18em;
Index: trunk/phase3/includes/SearchEngine.php
@@ -43,11 +43,6 @@
4444 return null;
4545 }
4646
47 - /** If this search backend can list/unlist redirects */
48 - function acceptListRedirects() {
49 - return true;
50 - }
51 -
5247 /**
5348 * If an exact title match can be find, or a very slightly close match,
5449 * return the title. If no match, returns NULL.
@@ -233,10 +228,6 @@
234229 */
235230 public static function userNamespaces( &$user ) {
236231 $arr = array();
237 - // for logged-in users use predefined defaults
238 - if( $user->isLoggedIn() && $user->getOption( 'defaultusersearch', true ) )
239 - return SearchEngine::projectNamespaces();
240 -
241232 foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
242233 if( $user->getOption( 'searchNs' . $ns ) ) {
243234 $arr[] = $ns;
@@ -271,39 +262,8 @@
272263
273264 return array_keys($wgNamespacesToBeSearchedDefault, true);
274265 }
275 -
 266+
276267 /**
277 - * Get a list of namespace names useful for showing in tooltips
278 - * and preferences
279 - *
280 - * @param unknown_type $namespaces
281 - */
282 - public static function namespacesAsText( $namespaces ){
283 - global $wgContLang;
284 -
285 - $formatted = array_map( array($wgContLang,'getFormattedNsText'), $namespaces );
286 - foreach( $formatted as $key => $ns ){
287 - if ( empty($ns) )
288 - $formatted[$key] = wfMsg( 'blanknamespace' );
289 - }
290 - return $formatted;
291 - }
292 -
293 - /**
294 - * An array of "project" namespaces indexes typically searched
295 - * by logged-in users
296 - *
297 - * @return array
298 - * @static
299 - */
300 - public static function projectNamespaces(){
301 - global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject;
302 -
303 - return array_keys( $wgNamespacesToBeSearchedDefault +
304 - $wgNamespacesToBeSearchedProject, true);
305 - }
306 -
307 - /**
308268 * Return a 'cleaned up' search string
309269 *
310270 * @return string
@@ -387,7 +347,6 @@
388348 else
389349 return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}';
390350 }
391 -
392351 }
393352
394353 /**
@@ -524,17 +483,11 @@
525484 */
526485 class SearchResult {
527486 var $mRevision = null;
528 - var $mImage = null;
529487
530488 function SearchResult( $row ) {
531489 $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
532 - if( !is_null($this->mTitle) ){
 490+ if( !is_null($this->mTitle) )
533491 $this->mRevision = Revision::newFromTitle( $this->mTitle );
534 - if($this->mTitle->getNamespace() == NS_IMAGE)
535 - $this->mImage = wfFindFile( $this->mTitle );
536 - }
537 -
538 -
539492 }
540493
541494 /**
@@ -556,7 +509,7 @@
557510 * @access public
558511 */
559512 function isMissingRevision(){
560 - if( !$this->mRevision && !$this->mImage )
 513+ if( !$this->mRevision )
561514 return true;
562515 return false;
563516 }
@@ -581,10 +534,7 @@
582535 */
583536 protected function initText(){
584537 if( !isset($this->mText) ){
585 - if($this->mRevision != null)
586 - $this->mText = $this->mRevision->getText();
587 - else
588 - $this->mText = '';
 538+ $this->mText = $this->mRevision->getText();
589539 }
590540 }
591541
@@ -644,10 +594,7 @@
645595 * @return string timestamp
646596 */
647597 function getTimestamp(){
648 - if($this->mRevision != null)
649 - return $this->mRevision->getTimestamp();
650 - else
651 - return '';
 598+ return $this->mRevision->getTimestamp();
652599 }
653600
654601 /**
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1865,26 +1865,11 @@
18661866 NS_CATEGORY_TALK => true
18671867 );
18681868
1869 -/** Default search for anonymous users */
18701869 $wgNamespacesToBeSearchedDefault = array(
18711870 NS_MAIN => true,
18721871 );
18731872
18741873 /**
1875 - * Additional namespaces to those in $wgNamespacesToBeSearchedDefault that
1876 - * will be added to default search for logged-in users.
1877 - *
1878 - * Same format as $wgNamespacesToBeSearchedDefault
1879 - */
1880 -$wgNamespacesToBeSearchedProject = array(
1881 - NS_USER => true,
1882 - NS_PROJECT => true,
1883 - NS_HELP => true,
1884 - NS_CATEGORY => true,
1885 -);
1886 -
1887 -
1888 -/**
18891874 * Site notice shown at the top of each page
18901875 *
18911876 * This message can contain wiki text, and can also be set through the
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -67,7 +67,6 @@
6868 $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' );
6969 $this->mWatchlistEdits = $request->getVal( 'wpWatchlistEdits' );
7070 $this->mDisableMWSuggest = $request->getCheck( 'wpDisableMWSuggest' );
71 - $this->mDefaultUserSearch = $request->getVal( 'wpUserSearch' ) != 'wpCustomUserSearch';
7271
7372 $this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) &&
7473 $this->mPosted &&
@@ -290,7 +289,6 @@
291290 $wgUser->setOption( 'underline', $this->validateInt($this->mUnderline, 0, 2) );
292291 $wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays, 0, 7 ) );
293292 $wgUser->setOption( 'disablesuggest', $this->mDisableMWSuggest );
294 - $wgUser->setOption( 'defaultusersearch', $this->mDefaultUserSearch );
295293
296294 # Set search namespace options
297295 foreach( $this->mSearchNs as $i => $value ) {
@@ -505,7 +503,7 @@
506504 return Xml::tags( 'tr', null, $td1 . $td2 ). $td3 . "\n";
507505
508506 }
509 -
 507+
510508 /**
511509 * @access private
512510 */
@@ -1050,16 +1048,11 @@
10511049 $wgOut->addHtml( '</fieldset>' );
10521050
10531051 # Search
1054 - $defaultNs = SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() );
10551052 $mwsuggest = $wgEnableMWSuggest ?
10561053 $this->addRow(
10571054 Xml::label( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ),
10581055 Xml::check( 'wpDisableMWSuggest', $this->mDisableMWSuggest, array( 'id' => 'wpDisableMWSuggest' ) )
10591056 ) : '';
1060 - $userDefaultSearch = '<p>'.Xml::radioLabel(wfMsg('prefs-search-nsdefault'),'wpUserSearch','wpDefaultUserSearch','wpDefaultUserSearch',$this->mDefaultUserSearch).
1061 - '</p>'.implode(', ', $defaultNs).'<br/><br/><p>'.
1062 - Xml::radioLabel(wfMsg('prefs-search-nscustom'),'wpUserSearch','wpCustomUserSearch','wpCustomUserSearch',!$this->mDefaultUserSearch).
1063 - '</p>';
10641057 $wgOut->addHTML(
10651058 // Elements for the search tab itself
10661059 Xml::openElement( 'fieldset' ) .
@@ -1086,7 +1079,7 @@
10871080 // Elements for the namespace options in the search tab
10881081 Xml::openElement( 'fieldset' ) .
10891082 Xml::element( 'legend', null, wfMsg( 'prefs-namespaces' ) ) .
1090 - $userDefaultSearch.
 1083+ wfMsgExt( 'defaultns', array( 'parse' ) ) .
10911084 $ps .
10921085 Xml::closeElement( 'fieldset' ) .
10931086 // End of the search tab
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -69,7 +69,6 @@
7070 }
7171
7272 $this->searchRedirects = $request->getcheck( 'redirs' ) ? true : false;
73 - $this->searchAdvanced = $request->getVal('advanced');
7473 }
7574
7675 /**
@@ -109,6 +108,13 @@
110109 }
111110 }
112111
 112+ $wgOut->wrapWikiMsg( "==$1==\n", 'notitlematches' );
 113+ if( $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) {
 114+ $wgOut->addWikiMsg( 'noexactmatch', wfEscapeWikiText( $term ) );
 115+ } else {
 116+ $wgOut->addWikiMsg( 'noexactmatch-nocreate', wfEscapeWikiText( $term ) );
 117+ }
 118+
113119 return $this->showResults( $term );
114120 }
115121
@@ -123,56 +129,14 @@
124130 $sk = $wgUser->getSkin();
125131
126132 $this->setupPage( $term );
127 - $this->searchEngine = SearchEngine::create();
128 -
129 - $t = Title::newFromText( $term );
130 -
131 - // add a table since it's difficult to stack divs horizontally nicely
132 - // left - search box, right - search menu
133133
134 - $wgOut->addHtml(
135 - Xml::openElement( 'table', array( 'border'=>'0' ) ).
136 - Xml::openElement( 'tr' ) .
137 - Xml::openElement( 'td' ) . "\n"
138 - );
139 -
140 -
141 - if( $this->searchAdvanced ){
142 - $wgOut->addHTML( $this->powerSearchBox( $term ) );
143 - $showMenu = false;
144 - } else {
145 - $wgOut->addHTML( $this->shortDialog( $term ) );
146 - $showMenu = true;
147 - }
148 -
149 - $wgOut->addHtml( Xml::closeElement( 'td' ) );
150 -
151 -
152 - $wgOut->addHtml( Xml::openElement('td', array( 'id' => 'mw-search-menu' )) );
153 -
154 - if( $showMenu ){
155 - if( $t!=null && $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) {
156 - if( $t->exists() ){
157 - $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $term ) );
158 - } else {
159 - $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $term ) );
160 - }
161 - }
162 - }
163 - if ( is_null($t) )
164 - $wgOut->addWikiMsg( 'searchmenu-badtitle', wfEscapeWikiText( $term ) );
165 - else
166 - $wgOut->addWikiMsg( 'searchmenu', wfEscapeWikiText( $term ) );
167 -
168 - $wgOut->addHtml(
169 - Xml::closeElement('td').
170 - Xml::closeElement('tr').
171 - Xml::closeElement('table')
172 - );
173 -
 134+ $wgOut->addWikiMsg( 'searchresulttext' );
174135
175136 if( '' === trim( $term ) ) {
176137 // Empty query -- straight view of search form
 138+ $wgOut->setSubtitle( '' );
 139+ $wgOut->addHTML( $this->powerSearchBox( $term ) );
 140+ $wgOut->addHTML( $this->powerSearchFocus() );
177141 wfProfileOut( $fname );
178142 return;
179143 }
@@ -201,7 +165,9 @@
202166 return;
203167 }
204168
205 - $search = $this->searchEngine;
 169+ $wgOut->addHTML( $this->shortDialog( $term ) );
 170+
 171+ $search = SearchEngine::create();
206172 $search->setLimitOffset( $this->limit, $this->offset );
207173 $search->setNamespaces( $this->namespaces );
208174 $search->showRedirects = $this->searchRedirects;
@@ -212,13 +178,14 @@
213179 // Sometimes the search engine knows there are too many hits
214180 if ($titleMatches instanceof SearchResultTooMany) {
215181 $wgOut->addWikiText( '==' . wfMsg( 'toomanymatches' ) . "==\n" );
 182+ $wgOut->addHTML( $this->powerSearchBox( $term ) );
 183+ $wgOut->addHTML( $this->powerSearchFocus() );
216184 wfProfileOut( $fname );
217185 return;
218186 }
219187
220188 $textMatches = $search->searchText( $rewritten );
221 -
222 -
 189+
223190 // did you mean... suggestions
224191 if($textMatches && $textMatches->hasSuggestion()){
225192 $st = SpecialPage::getTitleFor( 'Search' );
@@ -231,8 +198,8 @@
232199 $textMatches->getSuggestionSnippet().'</a>';
233200
234201 $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
235 - }
236 -
 202+ }
 203+
237204 // show number of results
238205 $num = ( $titleMatches ? $titleMatches->numRows() : 0 )
239206 + ( $textMatches ? $textMatches->numRows() : 0);
@@ -297,11 +264,12 @@
298265 }
299266
300267 if ( $num == 0 ) {
301 - $wgOut->addWikiMsg( 'search-nonefound' );
 268+ $wgOut->addWikiMsg( 'nonefound' );
302269 }
303270 if( $num || $this->offset ) {
304271 $wgOut->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
305272 }
 273+ $wgOut->addHTML( $this->powerSearchBox( $term ) );
306274 wfProfileOut( $fname );
307275 }
308276
@@ -317,6 +285,8 @@
318286 $wgOut->setPageTitle( wfMsg( 'searchresults') );
319287 $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'searchresults-title', $term) ) );
320288 }
 289+ $subtitlemsg = ( Title::newFromText( $term ) ? 'searchsubtitle' : 'searchsubtitleinvalid' );
 290+ $wgOut->setSubtitle( $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ) );
321291 $wgOut->setArticleRelated( false );
322292 $wgOut->setRobotPolicy( 'noindex,nofollow' );
323293 }
@@ -350,8 +320,6 @@
351321 $opt['ns' . $n] = 1;
352322 }
353323 $opt['redirs'] = $this->searchRedirects ? 1 : 0;
354 - if( $this->searchAdvanced )
355 - $opt['advanced'] = $this->searchAdvanced;
356324 return $opt;
357325 }
358326
@@ -631,18 +599,14 @@
632600 Xml::closeElement( 'span' ) . "\n";
633601 }
634602
635 - if( $this->searchEngine->acceptListRedirects() ){
636 - $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1', 'id' => 'redirs' ) );
637 - $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' );
638 - } else{
639 - $redirect = '';
640 - $redirectLabel = '';
641 - }
 603+ $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1', 'id' => 'redirs' ) );
 604+ $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' );
642605 $searchField = Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'powerSearchText' ) );
643606 $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'fulltext' ) ) . "\n";
644607 $searchTitle = SpecialPage::getTitleFor( 'Search' );
645608
646609 $out = Xml::openElement( 'form', array( 'id' => 'powersearch', 'method' => 'get', 'action' => $wgScript ) ) .
 610+ Xml::fieldset( wfMsg( 'powersearch-legend' ),
647611 Xml::hidden( 'title', $searchTitle->getPrefixedText() ) .
648612 "<p>" .
649613 wfMsgExt( 'powersearch-ns', array( 'parseinline' ) ) .
@@ -656,11 +620,10 @@
657621 "&nbsp;" .
658622 $searchField .
659623 "&nbsp;" .
660 - $searchButton.
 624+ $searchButton ) .
661625 "</form>";
662626
663 - return Xml::openElement( 'fieldset', array( 'id' => 'mw-searchoptions' ) ) . $this->formHeader($term) .
664 - $out . Xml::closeElement( 'fieldset' );
 627+ return $out;
665628 }
666629
667630 function powerSearchFocus() {
@@ -671,134 +634,18 @@
672635 "});" .
673636 "</script>";
674637 }
675 -
676 - /** Make a search link with some target namespaces */
677 - function makeSearchLink($term, $namespaces, $label, $tooltip, $params=array()){
678 - $opt = $params;
679 - foreach( $namespaces as $n ) {
680 - $opt['ns' . $n] = 1;
681 - }
682 - $opt['redirs'] = $this->searchRedirects ? 1 : 0;
683 -
684 - $st = SpecialPage::getTitleFor( 'Search' );
685 - $stParams = wfArrayToCGI( array(
686 - 'search' => $term,
687 - 'fulltext' => wfMsg( 'search' ) ),
688 - $opt);
689 -
690 - return Xml::element( 'a',
691 - array( 'href'=> $st->getLocalURL( $stParams ), 'title' => $tooltip ),
692 - $label );
693 -
694 - }
695 -
696 - /** Check if query starts with image: prefix */
697 - function startsWithImage( $term ){
698 - global $wgContLang;
699 -
700 - $p = explode( ':', $term );
701 - if( count( $p ) > 1 ){
702 - return $wgContLang->getNsIndex( $p[0] ) == NS_IMAGE;
703 - }
704 - return false;
705 - }
706 -
707 - /** Check if query begins with all: magic prefix */
708 - function startsWithAll($term){
709 - global $wgContLang;
710 -
711 - $p = explode( ':', $term );
712 - return count( $p ) > 1 && $p[0] == wfMsg( 'searchall' );
713 - }
714638
715 - function formHeader( $term ) {
716 - global $wgContLang;
717 -
718 - $sep = '&nbsp;&nbsp;&nbsp;';
719 - $out = Xml::openElement('div', array( 'style' => 'padding-bottom:0.5em;' ) );
720 -
721 - $bareterm = $term;
722 - if( $this->startsWithAll( $term ) || $this->startsWithImage( $term ) )
723 - $bareterm = substr( $term, strpos( $term, ':' ) + 1 ); // delete all/image prefix
724 -
725 - // figure out the active search profile header
726 - if( $this->searchAdvanced )
727 - $active = 'advanced';
728 - else if( $this->namespaces == NS_IMAGE || $this->startsWithImage( $term ) )
729 - $active = 'images';
730 - elseif( $this->startsWithAll( $term ) )
731 - $active = 'all';
732 - elseif( $this->namespaces == SearchEngine::defaultNamespaces() )
733 - $active = 'default';
734 - elseif( $this->namespaces == SearchEngine::projectNamespaces() )
735 - $active = 'project';
736 - else
737 - $active = 'advanced';
738 -
739 -
740 - // search profiles headers
741 - $m = wfMsg( 'searchprofile-articles' );
742 - $tt = wfMsg( 'searchprofile-articles-tooltip',
743 - implode( ', ', SearchEngine::namespacesAsText( SearchEngine::defaultNamespaces() ) ) );
744 - if( $active == 'default' ){
745 - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );
746 - } else
747 - $out .= $this->makeSearchLink( $bareterm, SearchEngine::defaultNamespaces(), $m, $tt );
748 -
749 - $out .= $sep;
750 -
751 - $m = wfMsg( 'searchprofile-project' );
752 - $tt = wfMsg( 'searchprofile-project-tooltip',
753 - implode( ', ', SearchEngine::namespacesAsText( SearchEngine::projectNamespaces() ) ) );
754 - if( $active == 'project' ){
755 - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );
756 - } else
757 - $out .= $this->makeSearchLink( $bareterm, SearchEngine::projectNamespaces(), $m, $tt );
758 -
759 - $out .= $sep;
760 -
761 - $m = wfMsg( 'searchprofile-images' );
762 - $tt = wfMsg( 'searchprofile-images-tooltip' );
763 - if( $active == 'images' ){
764 - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );
765 - } else
766 - $out .= $this->makeSearchLink( $wgContLang->getFormattedNsText(NS_IMAGE).':'.$bareterm, array() , $m, $tt );
767 -
768 - $out .= $sep;
769 -
770 - $m = wfMsg( 'searchprofile-everything' );
771 - $tt = wfMsg( 'searchprofile-everything-tooltip' );
772 - if( $active == 'all' ){
773 - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );
774 - } else
775 - $out .= $this->makeSearchLink( wfMsg( 'searchall' ).':'.$bareterm, array() , $m, $tt );
776 -
777 - $out .= $sep;
778 -
779 - $m = wfMsg( 'searchprofile-advanced' );
780 - $tt = wfMsg( 'searchprofile-advanced-tooltip' );
781 - if( $active == 'advanced' ){
782 - $out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );
783 - } else
784 - $out .= $this->makeSearchLink( $bareterm, array() , $m, $tt, array( 'advanced' => '1' ) );
785 -
786 - $out .= Xml::closeElement('div') ;
787 -
788 - return $out;
789 - }
790 -
791 - function shortDialog( $term ) {
 639+ function shortDialog($term) {
792640 global $wgScript;
793 -
794 - $out = Xml::openElement( 'form', array(
 641+
 642+ $out = Xml::openElement( 'form', array(
795643 'id' => 'search',
796644 'method' => 'get',
797645 'action' => $wgScript
798646 ));
799647 $searchTitle = SpecialPage::getTitleFor( 'Search' );
800 - $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n";
801 - $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . "\n";
802 -
 648+ $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() );
 649+ $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . ' ';
803650 foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
804651 if( in_array( $ns, $this->namespaces ) ) {
805652 $out .= Xml::hidden( "ns{$ns}", '1' );
@@ -806,7 +653,7 @@
807654 }
808655 $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) );
809656 $out .= Xml::closeElement( 'form' );
810 - return Xml::openElement( 'fieldset', array( 'id' => 'mw-searchoptions' ) ) . $this->formHeader($term) .
811 - $out . Xml::closeElement( 'fieldset' );
 657+
 658+ return $out;
812659 }
813660 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1415,61 +1415,49 @@
14161416 'diff-strike' => "'''strikethrough'''",
14171417
14181418 # Search results
1419 -'searchresults' => 'Search results',
1420 -'searchresults-title' => 'Search results for $1',
1421 -'toomanymatches' => 'Too many matches were returned, please try a different query',
1422 -'titlematches' => 'Page title matches',
1423 -'notitlematches' => 'No page title matches',
1424 -'textmatches' => 'Page text matches',
1425 -'notextmatches' => 'No page text matches',
1426 -'prevn' => 'previous $1',
1427 -'nextn' => 'next $1',
1428 -'viewprevnext' => 'View ($1) ($2) ($3)',
1429 -'searchmenu-exists' => "* Page '''[[$1]]'''",
1430 -'searchmenu-new' => "* Create page '''[[$1]]'''",
1431 -'searchhelp-url' => 'Project:Searching',
1432 -'searchmenu-badtitle' => '* "$1" is not a valid title.
1433 -* [[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]',
1434 -'searchmenu' => '* [[Special:AllPages/$1|Index]]
1435 -* [[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]',
1436 -'searchprofile-articles' => 'Pages',
1437 -'searchprofile-project' => 'Pages/Project',
1438 -'searchprofile-images' => 'Files',
1439 -'searchprofile-everything' => 'Everything',
1440 -'searchprofile-advanced' => 'Advanced',
1441 -'searchprofile-articles-tooltip' => 'Search in $1',
1442 -'searchprofile-project-tooltip' => 'Search in $1',
1443 -'searchprofile-images-tooltip' => 'Search for files',
1444 -'searchprofile-everything-tooltip' => 'Search all of content (including talk pages)',
1445 -'searchprofile-advanced-tooltip' => 'Search in custom namespaces',
1446 -'prefs-search-nsdefault' => 'Search using defaults:',
1447 -'prefs-search-nscustom' => 'Search custom namespaces:',
1448 -'search-result-size' => '$1 ({{PLURAL:$2|1 word|$2 words}})',
1449 -'search-result-score' => 'Relevance: $1%',
1450 -'search-redirect' => '(redirect $1)',
1451 -'search-section' => '(section $1)',
1452 -'search-suggest' => 'Did you mean: $1',
1453 -'search-interwiki-caption' => 'Sister projects',
1454 -'search-interwiki-default' => '$1 results:',
1455 -'search-interwiki-custom' => '', # do not translate or duplicate this message to other languages
1456 -'search-interwiki-more' => '(more)',
1457 -'search-mwsuggest-enabled' => 'with suggestions',
1458 -'search-mwsuggest-disabled' => 'no suggestions',
1459 -'search-relatedarticle' => 'Related',
1460 -'mwsuggest-disable' => 'Disable AJAX suggestions',
1461 -'searchrelated' => 'related',
1462 -'searchall' => 'all',
1463 -'showingresults' => "Showing below up to {{PLURAL:$1|'''1''' result|'''$1''' results}} starting with #'''$2'''.",
1464 -'showingresultsnum' => "Showing below {{PLURAL:$3|'''1''' result|'''$3''' results}} starting with #'''$2'''.",
1465 -'showingresultstotal' => "Showing below {{PLURAL:$4|result '''$1''' of '''$3'''|results '''$1 - $2''' of '''$3'''}}",
1466 -'search-nonefound' => 'There were no results matching the query.',
1467 -'powersearch' => 'Advanced search',
1468 -'powersearch-legend' => 'Advanced search',
1469 -'powersearch-ns' => 'Search in namespaces:',
1470 -'powersearch-redir' => 'List redirects',
1471 -'powersearch-field' => 'Search for',
1472 -'search-external' => 'External search',
1473 -'searchdisabled' => '{{SITENAME}} search is disabled.
 1419+'searchresults' => 'Search results',
 1420+'searchresults-title' => 'Search results for $1',
 1421+'searchresulttext' => 'For more information about searching {{SITENAME}}, see [[{{MediaWiki:Helppage}}|{{int:help}}]].',
 1422+'searchsubtitle' => 'You searched for \'\'\'[[:$1]]\'\'\' ([[Special:Prefixindex/$1|all pages starting with "$1"]] | [[Special:WhatLinksHere/$1|all pages that link to "$1"]])',
 1423+'searchsubtitleinvalid' => "You searched for '''$1'''",
 1424+'noexactmatch' => "'''There is no page titled \"\$1\".'''
 1425+You can [[:\$1|create this page]].",
 1426+'noexactmatch-nocreate' => "'''There is no page titled \"\$1\".'''",
 1427+'toomanymatches' => 'Too many matches were returned, please try a different query',
 1428+'titlematches' => 'Page title matches',
 1429+'notitlematches' => 'No page title matches',
 1430+'textmatches' => 'Page text matches',
 1431+'notextmatches' => 'No page text matches',
 1432+'prevn' => 'previous $1',
 1433+'nextn' => 'next $1',
 1434+'viewprevnext' => 'View ($1) ($2) ($3)',
 1435+'search-result-size' => '$1 ({{PLURAL:$2|1 word|$2 words}})',
 1436+'search-result-score' => 'Relevance: $1%',
 1437+'search-redirect' => '(redirect $1)',
 1438+'search-section' => '(section $1)',
 1439+'search-suggest' => 'Did you mean: $1',
 1440+'search-interwiki-caption' => 'Sister projects',
 1441+'search-interwiki-default' => '$1 results:',
 1442+'search-interwiki-custom' => '', # do not translate or duplicate this message to other languages
 1443+'search-interwiki-more' => '(more)',
 1444+'search-mwsuggest-enabled' => 'with suggestions',
 1445+'search-mwsuggest-disabled' => 'no suggestions',
 1446+'search-relatedarticle' => 'Related',
 1447+'mwsuggest-disable' => 'Disable AJAX suggestions',
 1448+'searchrelated' => 'related',
 1449+'searchall' => 'all',
 1450+'showingresults' => "Showing below up to {{PLURAL:$1|'''1''' result|'''$1''' results}} starting with #'''$2'''.",
 1451+'showingresultsnum' => "Showing below {{PLURAL:$3|'''1''' result|'''$3''' results}} starting with #'''$2'''.",
 1452+'showingresultstotal' => "Showing below {{PLURAL:$4|result '''$1''' of '''$3'''|results '''$1 - $2''' of '''$3'''}}",
 1453+'nonefound' => "'''Note''': Only some namespaces are searched by default.
 1454+Try prefixing your query with ''all:'' to search all content (including talk pages, templates, etc), or use the desired namespace as prefix.",
 1455+'powersearch' => 'Advanced search',
 1456+'powersearch-legend' => 'Advanced search',
 1457+'powersearch-ns' => 'Search in namespaces:',
 1458+'powersearch-redir' => 'List redirects',
 1459+'powersearch-field' => 'Search for',
 1460+'search-external' => 'External search',
 1461+'searchdisabled' => '{{SITENAME}} search is disabled.
14741462 You can search via Google in the meantime.
14751463 Note that their indexes of {{SITENAME}} content may be out of date.',
14761464 'googlesearch' => '<form method="get" action="http://www.google.com/search" id="googlesearch">
@@ -1552,6 +1540,7 @@
15531541 'allowemail' => 'Enable e-mail from other users',
15541542 'prefs-searchoptions' => 'Search options',
15551543 'prefs-namespaces' => 'Namespaces',
 1544+'defaultns' => 'Search in these namespaces by default:',
15561545 'default' => 'default',
15571546 'files' => 'Files',
15581547

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r42352Redesign Special:Search:...rainman23:08, 22 October 2008
r42355Throw a fieldset around the new search options.demon00:28, 23 October 2008
r42363fix XHTML error per report on [[Special:Code/MediaWiki/42352]]ialex10:33, 23 October 2008
r42410Don't show a broken wikilink to Special:Allpages when searching for an invali...mrzman21:13, 23 October 2008

Status & tagging log