Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -95,7 +95,6 @@ |
96 | 96 | 'anonnotice', |
97 | 97 | 'autoblock_whitelist', |
98 | 98 | 'searchmenu-help', |
99 | | - 'searchmenu-new-nocreate', |
100 | 99 | 'googlesearch', |
101 | 100 | 'opensearch-desc', |
102 | 101 | 'exif-make-value', |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -103,12 +103,12 @@ |
104 | 104 | } |
105 | 105 | # If there's an exact or very near match, jump right there. |
106 | 106 | $t = SearchEngine::getNearMatch( $term ); |
107 | | - |
| 107 | + |
108 | 108 | if ( !wfRunHooks( 'SpecialSearchGo', array( &$t, &$term ) ) ) { |
109 | 109 | # Hook requested termination |
110 | 110 | return; |
111 | 111 | } |
112 | | - |
| 112 | + |
113 | 113 | if( !is_null( $t ) ) { |
114 | 114 | $wgOut->redirect( $t->getFullURL() ); |
115 | 115 | return; |
— | — | @@ -243,7 +243,7 @@ |
244 | 244 | $wgOut->addHTML( $this->formHeader($term, 0, 0)); |
245 | 245 | if( $this->searchAdvanced ) { |
246 | 246 | $wgOut->addHTML( $this->powerSearchBox( $term ) ); |
247 | | - } |
| 247 | + } |
248 | 248 | $wgOut->addHTML( '</form>' ); |
249 | 249 | // Empty query -- straight view of search form |
250 | 250 | wfProfileOut( __METHOD__ ); |
— | — | @@ -255,7 +255,7 @@ |
256 | 256 | $textMatchesNum = $textMatches ? $textMatches->numRows() : 0; |
257 | 257 | // Total initial query matches (possible false positives) |
258 | 258 | $num = $titleMatchesNum + $textMatchesNum; |
259 | | - |
| 259 | + |
260 | 260 | // Get total actual results (after second filtering, if any) |
261 | 261 | $numTitleMatches = $titleMatches && !is_null( $titleMatches->getTotalHits() ) ? |
262 | 262 | $titleMatches->getTotalHits() : $titleMatchesNum; |
— | — | @@ -268,13 +268,13 @@ |
269 | 269 | $totalRes += $titleMatches->getTotalHits(); |
270 | 270 | if($textMatches && !is_null( $textMatches->getTotalHits() )) |
271 | 271 | $totalRes += $textMatches->getTotalHits(); |
272 | | - |
| 272 | + |
273 | 273 | // show number of results and current offset |
274 | 274 | $wgOut->addHTML( $this->formHeader($term, $num, $totalRes)); |
275 | 275 | if( $this->searchAdvanced ) { |
276 | 276 | $wgOut->addHTML( $this->powerSearchBox( $term ) ); |
277 | 277 | } |
278 | | - |
| 278 | + |
279 | 279 | $wgOut->addHtml( Xml::closeElement( 'form' ) ); |
280 | 280 | $wgOut->addHtml( "<div class='searchresults'>" ); |
281 | 281 | |
— | — | @@ -291,7 +291,7 @@ |
292 | 292 | wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) ); |
293 | 293 | } else { |
294 | 294 | wfRunHooks( 'SpecialSearchNoResults', array( $term ) ); |
295 | | - } |
| 295 | + } |
296 | 296 | |
297 | 297 | $wgOut->parserOptions()->setEditSection( false ); |
298 | 298 | if( $titleMatches ) { |
— | — | @@ -332,10 +332,10 @@ |
333 | 333 | } |
334 | 334 | wfProfileOut( __METHOD__ ); |
335 | 335 | } |
336 | | - |
| 336 | + |
337 | 337 | protected function showCreateLink( $t ) { |
338 | 338 | global $wgOut; |
339 | | - |
| 339 | + |
340 | 340 | // show direct page/create link if applicable |
341 | 341 | $messageName = null; |
342 | 342 | if( !is_null($t) ) { |
— | — | @@ -346,7 +346,7 @@ |
347 | 347 | } else { |
348 | 348 | $messageName = 'searchmenu-new-nocreate'; |
349 | 349 | } |
350 | | - } |
| 350 | + } |
351 | 351 | if( $messageName ) { |
352 | 352 | $wgOut->wrapWikiMsg( "<p class=\"mw-search-createlink\">\n$1</p>", array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) ) ); |
353 | 353 | } else { |
— | — | @@ -365,12 +365,12 @@ |
366 | 366 | $this->active = 'advanced'; |
367 | 367 | } else { |
368 | 368 | $profiles = $this->getSearchProfiles(); |
369 | | - |
| 369 | + |
370 | 370 | foreach( $profiles as $key => $data ) { |
371 | 371 | if ( $this->namespaces == $data['namespaces'] && $key != 'advanced') |
372 | 372 | $this->active = $key; |
373 | 373 | } |
374 | | - |
| 374 | + |
375 | 375 | } |
376 | 376 | # Should advanced UI be used? |
377 | 377 | $this->searchAdvanced = ($this->active === 'advanced'); |
— | — | @@ -467,9 +467,9 @@ |
468 | 468 | |
469 | 469 | if( $titleSnippet == '' ) |
470 | 470 | $titleSnippet = null; |
471 | | - |
| 471 | + |
472 | 472 | $link_t = clone $t; |
473 | | - |
| 473 | + |
474 | 474 | wfRunHooks( 'ShowSearchHitTitle', |
475 | 475 | array( &$link_t, &$titleSnippet, $result, $terms, $this ) ); |
476 | 476 | |
— | — | @@ -777,7 +777,7 @@ |
778 | 778 | } |
779 | 779 | $rows = array_values( $rows ); |
780 | 780 | $numRows = count( $rows ); |
781 | | - |
| 781 | + |
782 | 782 | // Lays out namespaces in multiple floating two-column tables so they'll |
783 | 783 | // be arranged nicely while still accommodating different screen widths |
784 | 784 | $namespaceTables = ''; |
— | — | @@ -841,11 +841,11 @@ |
842 | 842 | Html::hidden( 'fulltext', 'Advanced search' ) . |
843 | 843 | Xml::closeElement( 'fieldset' ); |
844 | 844 | } |
845 | | - |
| 845 | + |
846 | 846 | protected function getSearchProfiles() { |
847 | 847 | // Builds list of Search Types (profiles) |
848 | 848 | $nsAllSet = array_keys( SearchEngine::searchableNamespaces() ); |
849 | | - |
| 849 | + |
850 | 850 | $profiles = array( |
851 | 851 | 'default' => array( |
852 | 852 | 'message' => 'searchprofile-articles', |
— | — | @@ -880,21 +880,21 @@ |
881 | 881 | 'parameters' => array( 'advanced' => 1 ), |
882 | 882 | ) |
883 | 883 | ); |
884 | | - |
| 884 | + |
885 | 885 | wfRunHooks( 'SpecialSearchProfiles', array( &$profiles ) ); |
886 | 886 | |
887 | 887 | foreach( $profiles as &$data ) { |
888 | 888 | sort($data['namespaces']); |
889 | 889 | } |
890 | | - |
| 890 | + |
891 | 891 | return $profiles; |
892 | 892 | } |
893 | 893 | |
894 | 894 | protected function formHeader( $term, $resultsShown, $totalNum ) { |
895 | 895 | global $wgLang; |
896 | | - |
| 896 | + |
897 | 897 | $out = Xml::openElement('div', array( 'class' => 'mw-search-formheader' ) ); |
898 | | - |
| 898 | + |
899 | 899 | $bareterm = $term; |
900 | 900 | if( $this->startsWithImage( $term ) ) { |
901 | 901 | // Deletes prefixes |
— | — | @@ -902,7 +902,7 @@ |
903 | 903 | } |
904 | 904 | |
905 | 905 | $profiles = $this->getSearchProfiles(); |
906 | | - |
| 906 | + |
907 | 907 | // Outputs XML for Search Types |
908 | 908 | $out .= Xml::openElement( 'div', array( 'class' => 'search-types' ) ); |
909 | 909 | $out .= Xml::openElement( 'ul' ); |
— | — | @@ -919,7 +919,7 @@ |
920 | 920 | $profile['namespaces'], |
921 | 921 | wfMsg( $profile['message'] ), |
922 | 922 | wfMsg( $profile['tooltip'], $tooltipParam ), |
923 | | - isset( $profile['parameters'] ) ? $profile['parameters'] : array() |
| 923 | + isset( $profile['parameters'] ) ? $profile['parameters'] : array() |
924 | 924 | ) |
925 | 925 | ); |
926 | 926 | } |
— | — | @@ -945,17 +945,17 @@ |
946 | 946 | Xml::tags( 'ul', null, Xml::tags( 'li', null, $top ) ) |
947 | 947 | ); |
948 | 948 | } |
949 | | - |
| 949 | + |
950 | 950 | $out .= Xml::element( 'div', array( 'style' => 'clear:both' ), '', false ); |
951 | 951 | $out .= Xml::closeElement('div'); |
952 | | - |
| 952 | + |
953 | 953 | // Adds hidden namespace fields |
954 | 954 | if ( !$this->searchAdvanced ) { |
955 | 955 | foreach( $this->namespaces as $ns ) { |
956 | 956 | $out .= Html::hidden( "ns{$ns}", '1' ); |
957 | 957 | } |
958 | 958 | } |
959 | | - |
| 959 | + |
960 | 960 | return $out; |
961 | 961 | } |
962 | 962 | |
— | — | @@ -972,7 +972,7 @@ |
973 | 973 | ) ) . "\n"; |
974 | 974 | $out .= Html::hidden( 'fulltext', 'Search' ) . "\n"; |
975 | 975 | $out .= Xml::submitButton( wfMsg( 'searchbutton' ) ) . "\n"; |
976 | | - return $out . $this->didYouMeanHtml; |
| 976 | + return $out . $this->didYouMeanHtml; |
977 | 977 | } |
978 | 978 | |
979 | 979 | /** |
— | — | @@ -1005,7 +1005,7 @@ |
1006 | 1006 | 'a', |
1007 | 1007 | array( |
1008 | 1008 | 'href' => $st->getLocalURL( $stParams ), |
1009 | | - 'title' => $tooltip, |
| 1009 | + 'title' => $tooltip, |
1010 | 1010 | 'onmousedown' => 'mwSearchHeaderClick(this);', |
1011 | 1011 | 'onkeydown' => 'mwSearchHeaderClick(this);'), |
1012 | 1012 | $label |
— | — | @@ -1027,7 +1027,7 @@ |
1028 | 1028 | } |
1029 | 1029 | return false; |
1030 | 1030 | } |
1031 | | - |
| 1031 | + |
1032 | 1032 | /** |
1033 | 1033 | * Check if query starts with all: prefix |
1034 | 1034 | * |
— | — | @@ -1037,7 +1037,7 @@ |
1038 | 1038 | protected function startsWithAll( $term ) { |
1039 | 1039 | |
1040 | 1040 | $allkeyword = wfMsgForContent('searchall'); |
1041 | | - |
| 1041 | + |
1042 | 1042 | $p = explode( ':', $term ); |
1043 | 1043 | if( count( $p ) > 1 ) { |
1044 | 1044 | return $p[0] == $allkeyword; |
— | — | @@ -1045,4 +1045,3 @@ |
1046 | 1046 | return false; |
1047 | 1047 | } |
1048 | 1048 | } |
1049 | | - |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1664,7 +1664,7 @@ |
1665 | 1665 | 'searchmenu-legend' => 'Search options', |
1666 | 1666 | 'searchmenu-exists' => "'''There is a page named \"[[:\$1]]\" on this wiki.'''", |
1667 | 1667 | 'searchmenu-new' => "'''Create the page \"[[:\$1]]\" on this wiki!'''", |
1668 | | -'searchmenu-new-nocreate' => '', # do not translate or duplicate this message to other languages |
| 1668 | +'searchmenu-new-nocreate' => '"$1" is an invalid page name or cannot be created by you.', |
1669 | 1669 | 'searchhelp-url' => 'Help:Contents', |
1670 | 1670 | 'searchmenu-prefix' => '[[Special:PrefixIndex/$1|Browse pages with this prefix]]', |
1671 | 1671 | 'searchmenu-help' => '[[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]?', # do not translate or duplicate this message to other languages |