diff options
author | Joey Hess <joey@kitenet.net> | 2010-05-14 20:38:08 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-05-14 20:38:08 -0400 |
commit | 3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7 (patch) | |
tree | a576b7cc02f5fccac70cd1fd4ee7d6e574479780 | |
parent | ce731ec33fc4b30fae1f99be7476d9cb1c494fc9 (diff) | |
download | ikiwiki-3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7.tar ikiwiki-3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7.tar.gz |
put back recentchangesurl
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.
-rw-r--r-- | IkiWiki/Plugin/recentchanges.pm | 17 | ||||
-rw-r--r-- | templates/page.tmpl | 3 |
2 files changed, 4 insertions, 16 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 0ee8f0e66..e546e4702 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -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}; diff --git a/templates/page.tmpl b/templates/page.tmpl index 049d31ad5..3bb7197f0 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -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> |