]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/search.pm
* Fix for missing backlinks() in pagestats plugin.
[ikiwiki.git] / IkiWiki / Plugin / search.pm
index a57a8404819b07f8449b634e0de32772a8c76ff8..1b5c66716f90faaff3fd36d26d909cce5d1710d7 100644 (file)
@@ -23,6 +23,7 @@ sub import { #{{{
 
 sub getopt () { #{{{
         eval q{use Getopt::Long};
 
 sub getopt () { #{{{
         eval q{use Getopt::Long};
+       error($@) if $@;
         Getopt::Long::Configure('pass_through');
         GetOptions("estseek=s" => \$config{estseek});
 } #}}}
         Getopt::Long::Configure('pass_through');
         GetOptions("estseek=s" => \$config{estseek});
 } #}}}
@@ -30,7 +31,7 @@ sub getopt () { #{{{
 sub checkconfig () { #{{{
        foreach my $required (qw(url cgiurl)) {
                if (! length $config{$required}) {
 sub checkconfig () { #{{{
        foreach my $required (qw(url cgiurl)) {
                if (! length $config{$required}) {
-                       error("Must specify $required when using the search plugin\n");
+                       error(sprintf(gettext("Must specify %s when using the search plugin"), $required));
                }
        }
 } #}}}
                }
        }
 } #}}}
@@ -54,13 +55,13 @@ sub pagetemplate (@) { #{{{
 } #}}}
 
 sub delete (@) { #{{{
 } #}}}
 
 sub delete (@) { #{{{
-       debug("cleaning hyperestraier search index");
+       debug(gettext("cleaning hyperestraier search index"));
        estcmd("purge -cl");
        estcfg();
 } #}}}
 
 sub change (@) { #{{{
        estcmd("purge -cl");
        estcfg();
 } #}}}
 
 sub change (@) { #{{{
-       debug("updating hyperestraier search index");
+       debug(gettext("updating hyperestraier search index"));
        estcmd("gather -cm -bc -cl -sd",
                map {
                        Encode::encode_utf8($config{destdir}."/".$_)
        estcmd("gather -cm -bc -cl -sd",
                map {
                        Encode::encode_utf8($config{destdir}."/".$_)
@@ -73,7 +74,7 @@ sub change (@) { #{{{
 sub cgi ($) { #{{{
        my $cgi=shift;
 
 sub cgi ($) { #{{{
        my $cgi=shift;
 
-       if (defined $cgi->param('phrase')) {
+       if (defined $cgi->param('phrase') || defined $cgi->param("navi")) {
                # only works for GET requests
                chdir("$config{wikistatedir}/hyperestraier") || error("chdir: $!");
                exec("./".IkiWiki::basename($config{cgiurl})) || error("estseek.cgi failed");
                # only works for GET requests
                chdir("$config{wikistatedir}/hyperestraier") || error("chdir: $!");
                exec("./".IkiWiki::basename($config{cgiurl})) || error("estseek.cgi failed");