From: intrigeri Date: Sat, 9 Jan 2010 21:54:34 +0000 (+0100) Subject: po: inject custom isselflink to fix selflink detection on translation pages X-Git-Tag: 3.20100722~8^2~8^2~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=73f4a8835876c8cb07808367cd72d9ae972893e8;p=ikiwiki.git po: inject custom isselflink to fix selflink detection on translation pages --- diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 02fc4a89e..bbbb3b870 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -63,6 +63,8 @@ sub import { inject(name => "IkiWiki::cgiurl", call => \&mycgiurl); $origsubs{'rootpage'}=\&IkiWiki::rootpage; inject(name => "IkiWiki::rootpage", call => \&myrootpage); + $origsubs{'isselflink'}=\&IkiWiki::isselflink; + inject(name => "IkiWiki::isselflink", call => \&myisselflink); } @@ -671,6 +673,17 @@ sub myrootpage (@) { return $rootpage; } +sub myisselflink ($$) { + my $page=shift; + my $link=shift; + + return 1 if $origsubs{'isselflink'}->($page, $link); + if (istranslation($page)) { + return $origsubs{'isselflink'}->(masterpage($page), $link); + } + return; +} + # ,---- # | Blackboxes for private data # `----