po: inject custom isselflink to fix selflink detection on translation pages

master
intrigeri 2010-01-09 22:54:34 +01:00
parent 88c6e28915
commit 73f4a88358
1 changed files with 13 additions and 0 deletions

View File

@ -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
# `----