From 2bec3518c22c2627df4062c80179a5b7027c52bf Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 26 Aug 2006 21:57:59 +0000 Subject: * Patch from James Westby to add a template for the search form. * Cache search form for speedup. --- IkiWiki/Plugin/search.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'IkiWiki') 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{ -
-
- - - -
-
-}); + 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); } } #}}} -- cgit v1.2.3