From 8c8ce06a1b267a5c5d0b1a4f2b229b6d15e63b71 Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 12 Jan 2007 20:48:19 +0000 Subject: * Search in default location for templates as a fallback when templatedir is pointed elsewhere, so that only modified templates need to be copied into a templatedir. Based on work by JeremyReed. --- IkiWiki/CGI.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 85fc1a386..b1f770b05 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -129,8 +129,7 @@ sub cgi_signin ($$) { #{{{ params => $q, action => $config{cgiurl}, header => 0, - template => (-e "$config{templatedir}/signin.tmpl" ? - {template_params("signin.tmpl")} : ""), + template => scalar template_params("signin.tmpl"), stylesheet => baseurl()."style.css", ); my $buttons=["Login"]; @@ -198,8 +197,7 @@ sub cgi_prefs ($$) { #{{{ javascript => 0, params => $q, action => $config{cgiurl}, - template => (-e "$config{templatedir}/prefs.tmpl" ? - {template_params("prefs.tmpl")} : ""), + template => scalar template_params("prefs.tmpl"), stylesheet => baseurl()."style.css", ); my $buttons=["Save Preferences", "Logout", "Cancel"]; @@ -293,8 +291,7 @@ sub cgi_editpage ($$) { #{{{ params => $q, action => $config{cgiurl}, table => 0, - template => (-e "$config{templatedir}/editpage.tmpl" ? - {template_params("editpage.tmpl")} : ""), + template => scalar template_params("editpage.tmpl"), ); run_hooks(formbuilder_setup => sub { -- cgit v1.2.3