]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
put back recentchangesurl
[ikiwiki.git] / IkiWiki.pm
index d76b5edb403b931e207ccd6dd4ac2f8f5da4fe95..a42f56bf0c6d2320c7403af19618e3b65f5f966a 100644 (file)
@@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
        my $time=formattime($_[0], $_[1]);
        if ($config{html5}) {
                return '<time datetime="'.date_3339($_[0]).'"'.
-                       ($_[2] ? ' pubdate' : '').
+                       ($_[2] ? ' pubdate="pubdate"' : '').
                        '>'.$time.'</time>';
        }
        else {
@@ -1748,7 +1748,6 @@ sub misctemplate ($$;@) {
 
        $template->param(
                dynamic => 1,
-               have_actions => 0, # force off
                title => $title,
                wikiname => $config{wikiname},
                content => $content,
@@ -1757,9 +1756,33 @@ sub misctemplate ($$;@) {
                @_,
        );
 
+       templateactions($template, "");
+       
        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 => $page);
+       });
+       $template->param(actions => \@actions);
+
+       if ($config{cgiurl} && exists $hooks{auth}) {
+               $template->param(prefsurl => cgiurl(do => "prefs"));
+               $have_actions=1;
+       }
+
+       if ($have_actions || @actions) {
+               $template->param(have_actions => 1);
+       }
+}
+
 sub hook (@) {
        my %param=@_;