summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-13 01:38:22 +0100
committerintrigeri <intrigeri@boum.org>2008-11-13 01:38:22 +0100
commitc390056eb2b99bcc3a528611f5a9fde79ea364cf (patch)
tree05fee8c511ace1d684412f2a8467939a5a68195e
parentcb1fe44f5d1b7154ee7d21f00fa6ecf4972815a7 (diff)
po(delete): added hook, and function skeleton
Not implemented yet, 'cos the renamepage hook has to come first. Else translations would be deleted on rename, what a shame. Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/po.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index d92443b18..60a9f2632 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -35,6 +35,7 @@ sub import { #{{{
hook(type => "filter", id => "po", call => \&filter);
hook(type => "htmlize", id => "po", call => \&htmlize);
hook(type => "pagetemplate", id => "po", call => \&pagetemplate, last => 1);
+ hook(type => "delete", id => "po", call => \&mydelete);
hook(type => "change", id => "po", call => \&change);
hook(type => "editcontent", id => "po", call => \&editcontent);
@@ -325,6 +326,12 @@ sub pagetemplate (@) { #{{{
}
} # }}}
+sub mydelete(@) { #{{{
+ my @deleted=@_;
+
+ map { deletetranslations($_) } grep istranslatablefile($_), @deleted;
+} #}}}
+
sub change(@) { #{{{
my @rendered=@_;
@@ -757,6 +764,13 @@ sub homepageurl (;$) { #{{{
return urlto('', $page);
} #}}}
+# do *not* implement this until the renamepage hook works
+sub deletetranslations ($) { #{{{
+ my $file=shift;
+
+ debug 'po(deletetranslations): TODO: delete translations of ' . $file;
+} #}}}
+
# ,----
# | PageSpec's
# `----