summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-26 21:57:59 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-26 21:57:59 +0000
commit2bec3518c22c2627df4062c80179a5b7027c52bf (patch)
tree99b7fe914a0565bb413e52432cfe075c12c0ecc0 /IkiWiki/Plugin
parent02a2de8ead6d7afd828643397e2f68f0c63acb70 (diff)
* Patch from James Westby to add a template for the search form.
* Cache search form for speedup.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/search.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 751c75ab5..c8e0dd580 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -27,6 +27,7 @@ sub checkconfig () { #{{{
}
} #}}}
+my $form;
sub pagetemplate (@) { #{{{
my %params=@_;
my $page=$params{page};
@@ -34,15 +35,13 @@ sub pagetemplate (@) { #{{{
# Add search box to page header.
if ($template->query(name => "searchform")) {
- $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="enc" value="UTF-8" />
-<input type="hidden" name="do" value="hyperestraier" />
-</div>
-</form>
-});
+ if (! defined $form) {
+ my $searchform = IkiWiki::template("searchform.tmpl", blind_cache => 1);
+ $searchform->param(searchaction => $IkiWiki::config{cgiurl});
+ $form=$searchform->output;
+ }
+
+ $template->param(searchform => $form);
}
} #}}}