sub getopt () { #{{{
eval q{use Getopt::Long};
+ error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("estseek=s" => \$config{estseek});
} #}}}
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));
}
}
} #}}}
} #}}}
sub delete (@) { #{{{
- debug("cleaning hyperestraier search index");
+ debug(gettext("cleaning hyperestraier search index"));
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}."/".$_)
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");