summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-01-09 22:54:34 +0100
committerintrigeri <intrigeri@boum.org>2010-01-09 22:54:34 +0100
commit73f4a8835876c8cb07808367cd72d9ae972893e8 (patch)
tree083918c22b52afbe212385022b833d6539fcc94a /IkiWiki/Plugin
parent88c6e2891593fd508701d728602515e47284180c (diff)
po: inject custom isselflink to fix selflink detection on translation pages
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm13
1 files changed, 13 insertions, 0 deletions
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
# `----