po: inject custom isselflink to fix selflink detection on translation pages
parent
88c6e28915
commit
73f4a88358
|
@ -63,6 +63,8 @@ sub import {
|
||||||
inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
|
inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
|
||||||
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
|
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
|
||||||
inject(name => "IkiWiki::rootpage", call => \&myrootpage);
|
inject(name => "IkiWiki::rootpage", call => \&myrootpage);
|
||||||
|
$origsubs{'isselflink'}=\&IkiWiki::isselflink;
|
||||||
|
inject(name => "IkiWiki::isselflink", call => \&myisselflink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -671,6 +673,17 @@ sub myrootpage (@) {
|
||||||
return $rootpage;
|
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
|
# | Blackboxes for private data
|
||||||
# `----
|
# `----
|
||||||
|
|
Loading…
Reference in New Issue