X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a..9c13e29d4fbb85a83b0ed5fd7271d7c1688fbc07:/IkiWiki/Render.pm?ds=inline diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index adae9f0d5..6900d5eed 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -24,13 +24,19 @@ sub calculate_backlinks () { $backlinks_calculated=1; } -sub backlinks ($) { +sub backlink_pages ($) { my $page=shift; calculate_backlinks(); + return keys %{$backlinks{$page}}; +} + +sub backlinks ($) { + my $page=shift; + my @links; - foreach my $p (keys %{$backlinks{$page}}) { + foreach my $p (backlink_pages($page)) { my $href=urlto($p, $page); # Trim common dir prefixes from both pages. @@ -65,7 +71,8 @@ sub genpage ($$) { if (length $config{cgiurl}) { $template->param(editurl => cgiurl(do => "edit", page => $page)) if IkiWiki->can("cgi_editpage"); - $template->param(prefsurl => cgiurl(do => "prefs")); + $template->param(prefsurl => cgiurl(do => "prefs")) + if exists $hooks{auth}; $actions++; } @@ -76,7 +83,7 @@ sub genpage ($$) { $actions++; } if ($config{discussion}) { - my $discussionlink=gettext("discussion"); + my $discussionlink=lc(gettext("Discussion")); if ($page !~ /.*\/\Q$discussionlink\E$/ && (length $config{cgiurl} || exists $links{$page."/".$discussionlink})) { @@ -146,7 +153,7 @@ sub scan ($) { if ($config{discussion}) { # Discussion links are a special case since they're # not in the text of the page, but on its template. - $links{$page}=[ $page."/".gettext("discussion") ]; + $links{$page}=[ $page."/".lc(gettext("Discussion")) ]; } else { $links{$page}=[];