]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/search.pm
todo++
[git.ikiwiki.info.git] / IkiWiki / Plugin / search.pm
index a9089620b7511948dcc5fd35e4a04c4f7245a31b..1cf762fce162fd6b7355c536bb5d06232d8a16ae 100644 (file)
@@ -13,6 +13,7 @@ sub import {
        hook(type => "indexhtml", id => "search", call => \&indexhtml);
        hook(type => "delete", id => "search", call => \&delete);
        hook(type => "cgi", id => "search", call => \&cgi);
+       hook(type => "disable", id => "search", call => \&disable);
 }
 
 sub getsetup () {
@@ -229,7 +230,8 @@ sub setupfiles () {
                # Avoid omega interpreting anything in the misctemplate
                # as an omegascript command.
                my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0",
-                       searching => 1);
+                       searchform => "", # avoid showing the small search form
+               );
                eval q{use HTML::Entities};
                error $@ if $@;
                $misctemplate=encode_entities($misctemplate, '\$');
@@ -244,4 +246,10 @@ sub setupfiles () {
 }
 }
 
+sub disable () {
+       if (-d $config{wikistatedir}."/xapian") {
+               system("rm", "-rf", $config{wikistatedir}."/xapian");
+       }
+}
+
 1