X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5a4c95cc352d6895c11542245981c62a5c003370..1e36ed1fe8cc4dd79a9b1831aec9690769952d92:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 46c29abe3..699ad13da 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1745,6 +1745,7 @@ sub misctemplate ($$;@) { run_hooks(pagetemplate => sub { shift->(page => "", destpage => "", template => $template); }); + templateactions($template, ""); $template->param( dynamic => 1, @@ -1756,17 +1757,29 @@ sub misctemplate ($$;@) { @_, ); + return $template->output; +} + +sub templateactions ($$) { + my $template=shift; + my $page=shift; + + my $have_actions=0; my @actions; run_hooks(pageactions => sub { push @actions, map { { action => $_ } } - grep { defined } shift->(page => ""); + grep { defined } shift->(page => $page); }); $template->param(actions => \@actions); - if (@actions) { - $template->param(have_actions => 1); + + if ($config{cgiurl} && exists $hooks{auth}) { + $template->param(prefsurl => cgiurl(do => "prefs")); + $have_actions=1; } - return $template->output; + if ($have_actions || @actions) { + $template->param(have_actions => 1); + } } sub hook (@) {