aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-01 23:18:09 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-01 23:18:09 +0000
commit457d6bbbbfbb0474749a0d68e959613c86facf72 (patch)
tree618480ea208d982d11f4bf07fd7ad127b1c25ee3
parent258af4c179f8bdd10c481efcf11617e368864457 (diff)
downloadikiwiki-457d6bbbbfbb0474749a0d68e959613c86facf72.tar
ikiwiki-457d6bbbbfbb0474749a0d68e959613c86facf72.tar.gz
change calling convention for preprocessor functions
-rw-r--r--IkiWiki/Render.pm23
1 files changed, 11 insertions, 12 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index f9da33e30..3006b64d4 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -146,7 +146,7 @@ sub preprocess ($$) { #{{{
while ($params =~ /(\w+)=\"([^"]+)"(\s+|$)/g) {
$params{$1}=$2;
}
- return $commands{$command}->($page, %params);
+ return $commands{$command}->(page => $page, %params);
}
else {
return "[[bad directive $command]]";
@@ -188,7 +188,6 @@ sub get_inline_content ($$) { #{{{
} #}}}
sub preprocess_inline ($@) { #{{{
- my $parentpage=shift;
my %params=@_;
if (! exists $params{pages}) {
@@ -200,11 +199,11 @@ sub preprocess_inline ($@) { #{{{
if (! exists $params{show} && $params{archive} eq "no") {
$params{show}=10;
}
- if (! exists $depends{$parentpage}) {
- $depends{$parentpage}=$params{pages};
+ if (! exists $depends{$params{page}}) {
+ $depends{$params{page}}=$params{pages};
}
else {
- $depends{$parentpage}.=" ".$params{pages};
+ $depends{$params{page}}.=" ".$params{pages};
}
my $ret="";
@@ -216,7 +215,7 @@ sub preprocess_inline ($@) { #{{{
$formtemplate->param(cgiurl => $config{cgiurl});
$formtemplate->param(rootpage => $params{rootpage});
if ($config{rss}) {
- $formtemplate->param(rssurl => rsspage(basename($parentpage)));
+ $formtemplate->param(rssurl => rsspage(basename($params{page})));
}
$ret.=$formtemplate->output;
}
@@ -224,7 +223,7 @@ sub preprocess_inline ($@) { #{{{
# Add a rss link button.
my $linktemplate=HTML::Template->new(blind_cache => 1,
filename => "$config{templatedir}/rsslink.tmpl");
- $linktemplate->param(rssurl => rsspage(basename($parentpage)));
+ $linktemplate->param(rssurl => rsspage(basename($params{page})));
$ret.=$linktemplate->output;
}
@@ -235,10 +234,10 @@ sub preprocess_inline ($@) { #{{{
my @pages;
foreach my $page (blog_list($params{pages}, $params{show})) {
- next if $page eq $parentpage;
+ next if $page eq $params{page};
push @pages, $page;
- $template->param(pagelink => htmllink($parentpage, $page));
- $template->param(content => get_inline_content($parentpage, $page))
+ $template->param(pagelink => htmllink($params{page}, $page));
+ $template->param(content => get_inline_content($params{page}, $page))
if $params{archive} eq "no";
$template->param(ctime => scalar(gmtime($pagectime{$page})));
$ret.=$template->output;
@@ -248,8 +247,8 @@ sub preprocess_inline ($@) { #{{{
# check_overwrite, but currently renderedfiles
# only supports listing one file per page.
if ($config{rss}) {
- writefile(rsspage($parentpage), $config{destdir},
- genrss($parentpage, @pages));
+ writefile(rsspage($params{page}), $config{destdir},
+ genrss($params{page}, @pages));
}
return $ret;