]> sipb.mit.edu Git - ikiwiki.git/commitdiff
put back recentchangesurl
authorJoey Hess <joey@kitenet.net>
Sat, 15 May 2010 00:38:08 +0000 (20:38 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 15 May 2010 00:38:08 +0000 (20:38 -0400)
On second thought, misctemplate can use pagetemplate hooks to provide
it, so it's better to keep back-compat, and allow full customisation
of how it's displayed via the template.

IkiWiki/Plugin/recentchanges.pm
templates/page.tmpl

index 0ee8f0e6671fcb9be708cab7a9e230a9587baded..e546e4702b43bda681e74996a51bcc6e6e3c0499 100644 (file)
@@ -11,8 +11,6 @@ sub import {
        hook(type => "getsetup", id => "recentchanges", call => \&getsetup);
        hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig);
        hook(type => "refresh", id => "recentchanges", call => \&refresh);
-       hook(type => "pageactions", id => "recentchanges", call => \&pageactions,
-               first => 1);
        hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate);
        hook(type => "htmlize", id => "_change", call => \&htmlize);
        # Load goto to fix up links from recentchanges
@@ -62,20 +60,7 @@ sub refresh ($) {
        }
 }
 
-# Enable the recentchanges link on wiki pages.
-sub pageactions (@) {
-       my %params=@_;
-       my $page=$params{page};
-
-       if (defined $config{recentchangespage} && $config{rcs} &&
-           $page ne $config{recentchangespage}) {
-               return htmllink($page, $page, $config{recentchangespage},
-                       linktext => gettext("RecentChanges"));
-       }
-}
-
-# Backwards compatability for templates still using
-# RECENTCHANGESURL.
+# Enable the recentchanges link.
 sub pagetemplate (@) {
        my %params=@_;
        my $template=$params{template};
index 049d31ad5e244299c56d5ef59303ac30b3c17aab..3bb7197f0e8e84f9fd22ce76dab9488478bdb899 100644 (file)
@@ -61,6 +61,9 @@
 <TMPL_IF EDITURL>
 <li><a href="<TMPL_VAR EDITURL>" rel="nofollow">Edit</a></li>
 </TMPL_IF>
+<TMPL_IF RECENTCHANGESURL>
+<li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li>
+</TMPL_IF>
 <TMPL_IF HISTORYURL>
 <li><a href="<TMPL_VAR HISTORYURL>">History</a></li>
 </TMPL_IF>