hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig);
hook(type => "refresh", id => "recentchanges", call => \&refresh);
hook(type => "htmlize", id => "_change", call => \&htmlize);
+ hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate);
} #}}}
sub checkconfig () { #{{{
}
} #}}}
+# Enable the recentchanges link on wiki pages.
+sub pagetemplate (@) { #{{{
+ my %params=@_;
+ my $template=$params{template};
+ my $page=$params{page};
+ if ($config{rcs} && $page ne $config{recentchangespage} &&
+ $template->query(name => "recentchangesurl")) {
+ $template->param(recentchangesurl => urlto($config{recentchangespage}, $page));
+ $template->param(have_actions => 1);
+ }
+} #}}}
+
# Pages with extension _change have plain html markup, pass through.
sub htmlize (@) { #{{{
my %params=@_;
$actions++;
}
- if ($config{rcs} && exists $config{recentchangespage} &&
- $page ne $config{recentchangespage}) {
- $template->param(recentchangesurl => urlto($config{recentchangespage}, $page));
- $actions++;
- }
-
if (length $config{historyurl}) {
my $u=$config{historyurl};
$u=~s/\[\[file\]\]/$pagesources{$page}/g;