summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-01-05 17:15:38 -0400
committerJoey Hess <joey@kitenet.net>2011-01-05 17:15:38 -0400
commitd991ccf134acbc2eec83b8409a5911744f1956eb (patch)
tree9b278b4ecbe8e0ecd6f8d00a310a7255c419bec4 /IkiWiki/Plugin
parent4a6ac6b485c7e6e312e42c3c609df693f5e531ec (diff)
use cgitemplate, remove misctemplate
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/comments.pm4
-rw-r--r--IkiWiki/Plugin/getsource.pm4
-rw-r--r--IkiWiki/Plugin/goto.pm2
-rw-r--r--IkiWiki/Plugin/openid.pm2
-rw-r--r--IkiWiki/Plugin/search.pm11
-rw-r--r--IkiWiki/Plugin/websetup.pm4
6 files changed, 14 insertions, 13 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 156d71daf..1287590a7 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -504,7 +504,7 @@ sub editcomment ($$) {
IkiWiki::saveindex();
IkiWiki::printheader($session);
- print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")),
+ print IkiWiki::cgitemplate($cgi, gettext(gettext("comment stored for moderation")),
"<p>".
gettext("Your comment will be posted after moderator review").
"</p>");
@@ -660,7 +660,7 @@ sub commentmoderation ($$) {
IkiWiki::run_hooks(format => sub {
$out = shift->(page => "", content => $out);
});
- print IkiWiki::misctemplate(gettext("comment moderation"), $out);
+ print IkiWiki::cgitemplate($cgi, gettext("comment moderation"), $out);
exit;
}
diff --git a/IkiWiki/Plugin/getsource.pm b/IkiWiki/Plugin/getsource.pm
index b362de726..0a21413bd 100644
--- a/IkiWiki/Plugin/getsource.pm
+++ b/IkiWiki/Plugin/getsource.pm
@@ -61,7 +61,7 @@ sub cgi_getsource ($) {
IkiWiki::cgi_custom_failure(
$cgi,
"404 Not Found",
- IkiWiki::misctemplate(gettext("missing page"),
+ IkiWiki::cgitemplate($cgi, gettext("missing page"),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
@@ -72,7 +72,7 @@ sub cgi_getsource ($) {
if (! defined pagetype($pagesources{$page})) {
IkiWiki::cgi_custom_failure(
$cgi->header(-status => "403 Forbidden"),
- IkiWiki::misctemplate(gettext("not a page"),
+ IkiWiki::cgitemplate($cgi, gettext("not a page"),
"<p>".
sprintf(gettext("%s is an attachment, not a page."),
htmllink("", "", $page)).
diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm
index 0eb83fc20..6b596ac8b 100644
--- a/IkiWiki/Plugin/goto.pm
+++ b/IkiWiki/Plugin/goto.pm
@@ -56,7 +56,7 @@ sub cgi_goto ($;$) {
IkiWiki::cgi_custom_failure(
$q,
"404 Not Found",
- IkiWiki::misctemplate(gettext("missing page"),
+ IkiWiki::cgitemplate($q, gettext("missing page"),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index ce0990e40..bd67384f2 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -84,7 +84,7 @@ sub openid_selector {
);
IkiWiki::printheader($session);
- print IkiWiki::misctemplate("signin", $template->output);
+ print IkiWiki::cgitemplate($q, "signin", $template->output);
exit;
}
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 78eb750b5..3f0b7c9ad 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -227,20 +227,21 @@ sub setupfiles () {
"database_dir .\n".
"template_dir ./templates\n");
- # Avoid omega interpreting anything in the misctemplate
+ # Avoid omega interpreting anything in the cgitemplate
# as an omegascript command.
- my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0",
+ eval q{use IkiWiki::CGI};
+ my $template=IkiWiki::cgitemplate(undef, gettext("search"), "\0",
searchform => "", # avoid showing the small search form
);
eval q{use HTML::Entities};
error $@ if $@;
- $misctemplate=encode_entities($misctemplate, '\$');
+ $template=encode_entities($template, '\$');
my $querytemplate=readfile(IkiWiki::template_file("searchquery.tmpl"));
- $misctemplate=~s/\0/$querytemplate/;
+ $template=~s/\0/$querytemplate/;
writefile("query", $config{wikistatedir}."/xapian/templates",
- $misctemplate);
+ $template);
$setup=1;
}
}
diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm
index 6a5190301..0a3d90aec 100644
--- a/IkiWiki/Plugin/websetup.pm
+++ b/IkiWiki/Plugin/websetup.pm
@@ -447,10 +447,10 @@ sub showform ($$) {
IkiWiki::saveindex();
IkiWiki::unlockwiki();
- # Print the top part of a standard misctemplate,
+ # Print the top part of a standard cgitemplate,
# then show the rebuild or refresh, live.
my $divider="\0";
- my $html=IkiWiki::misctemplate("setup", $divider);
+ my $html=IkiWiki::cgitemplate($cgi, "setup", $divider);
IkiWiki::printheader($session);
my ($head, $tail)=split($divider, $html, 2);
print $head."<pre>\n";