Index: trunk/extensions/LuceneSearch.php |
— | — | @@ -42,10 +42,11 @@ |
43 | 43 | $wgLuceneDisableTitleMatches = false; |
44 | 44 | |
45 | 45 | # Not a valid entry point, skip unless MEDIAWIKI is defined |
46 | | -require_once('SearchEngine.php'); |
47 | | -require_once('Article.php'); |
| 46 | +if (!defined('MEDIAWIKI')) { |
| 47 | + die( "This file is part of MediaWiki, it is not a valid entry point\n" ); |
| 48 | +} |
| 49 | + |
48 | 50 | |
49 | | -if (defined('MEDIAWIKI')) { |
50 | 51 | $wgExtensionFunctions[] = 'wfLuceneSearch'; |
51 | 52 | $wgExtensionCredits['specialpage'][] = array( |
52 | 53 | 'name' => 'LuceneSearch', |
— | — | @@ -63,6 +64,7 @@ |
64 | 65 | |
65 | 66 | global $IP; |
66 | 67 | require_once( $IP.'/includes/SpecialPage.php'); |
| 68 | +require_once($IP.'/includes/SearchEngine.php'); |
67 | 69 | |
68 | 70 | class LuceneSearch extends SpecialPage |
69 | 71 | { |
— | — | @@ -115,7 +117,7 @@ |
116 | 118 | $fname = 'LuceneSearch::execute'; |
117 | 119 | wfProfileIn( $fname ); |
118 | 120 | $this->setHeaders(); |
119 | | -$wgOut->addHTML('<!-- titlens = '. $wgTitle->getNamespace() . '-->'); |
| 121 | + $wgOut->addHTML('<!-- titlens = '. $wgTitle->getNamespace() . '-->'); |
120 | 122 | |
121 | 123 | foreach(SearchEngine::searchableNamespaces() as $ns => $name) |
122 | 124 | if ($wgRequest->getCheck('ns' . $ns)) |
— | — | @@ -789,24 +791,25 @@ |
790 | 792 | |
791 | 793 | global $wgMessageCache; |
792 | 794 | SpecialPage::addPage(new LuceneSearch); |
793 | | -$wgMessageCache->addMessage('searchnumber', "<strong>Results $1-$2 of $3</strong>"); |
794 | | -$wgMessageCache->addMessage('searchprev', "« <span style='font-size: small'>Prev</span>"); |
795 | | -$wgMessageCache->addMessage('searchnext', "<span style='font-size: small'>Next</span> »"); |
796 | | -$wgMessageCache->addMessage('searchscore', "Relevancy: $1"); |
797 | | -$wgMessageCache->addMessage('searchsize', "$1KB ($2 words)"); |
798 | | -$wgMessageCache->addMessage('searchdidyoumean', "Did you mean: \"<a href=\"$1\">$2</a>\"?"); |
799 | | -$wgMessageCache->addMessage('searchnoresults', "Sorry, there were no exact matches to your query."); |
800 | | -$wgMessageCache->addMessage('searchnearmatches', "<b>These pages have similar titles to your query:</b>\n"); |
801 | | -$wgMessageCache->addMessage('searchnearmatch', "<li>$1</li>\n"); |
802 | | -$wgMessageCache->addMessage('lucenepowersearchtext', " |
| 795 | +$wgMessageCache->addMessages(array( |
| 796 | + 'searchnumber' => "<strong>Results $1-$2 of $3</strong>", |
| 797 | + 'searchprev' => "« <span style='font-size: small'>Prev</span>", |
| 798 | + 'searchnext' => "<span style='font-size: small'>Next</span> »", |
| 799 | + 'searchscore' => "Relevancy: $1", |
| 800 | + 'searchsize' => "$1KB ($2 words)", |
| 801 | + 'searchdidyoumean' => "Did you mean: \"<a href=\"$1\">$2</a>\"?", |
| 802 | + 'searchnoresults' => "Sorry, there were no exact matches to your query.", |
| 803 | + 'searchnearmatches' => "<b>These pages have similar titles to your query:</b>\n", |
| 804 | + 'searchnearmatch' => "<li>$1</li>\n", |
| 805 | + 'lucenepowersearchtext', " |
803 | 806 | Search in namespaces:\n |
804 | 807 | $1\n |
805 | | -Search for $3 $9"); |
806 | | -$wgMessageCache->addMessage( "lucenefallback", |
| 808 | +Search for $3 $9", |
| 809 | + 'lucenefallback' => |
807 | 810 | "There was a problem with the wiki search. |
808 | 811 | This is probably temporary; try again in a few moments, |
809 | | -or you can search the wiki through an external search service:\n"); |
| 812 | +or you can search the wiki through an external search service:\n" |
| 813 | +)); |
810 | 814 | |
811 | 815 | } # End of extension function |
812 | | -} # End of invocation guard |
813 | 816 | ?> |