sub import { #{{{
IkiWiki::hook(type => "checkconfig", id => "hyperestraier",
call => \&checkconfig);
+ IkiWiki::hook(type => "pagetemplate", id => "hyperestraier",
+ call => \&pagetemplate);
IkiWiki::hook(type => "delete", id => "hyperestraier",
call => \&delete);
IkiWiki::hook(type => "change", id => "hyperestraier",
IkiWiki::error("Must specify $required when using the search plugin\n");
}
}
+} #}}}
+
+sub pagetemplate ($$) { #{{{
+ my $page=shift;
+ my $template=shift;
- $IkiWiki::config{headercontent}.=qq{
+ # Add search box to page header.
+ $template->param(searchform => qq{
<form method="get" action="$IkiWiki::config{cgiurl}" id="searchform">
<div>
<input type="text" name="phrase" value="" size="16" />
<input type="hidden" name="do" value="hyperestraier" />
</div>
</form>
-};
+});
} #}}}
sub delete (@) { #{{{