summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-01-01 16:50:24 +0100
committerintrigeri <intrigeri@boum.org>2009-01-01 16:52:43 +0100
commitb24f236dfa2903805bc233a7fc97101d912ae3ee (patch)
treeea9a0cf64dce136b3c4ec1b37522d60cd00f95bd /IkiWiki/Plugin
parent3316f9cc737c091ff79270f75fc30dd349616b12 (diff)
po: use the new canrename hook to prevent translation renames in the CGI
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 5670f3608..2dad3b60b 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -40,6 +40,7 @@ sub import {
hook(type => "delete", id => "po", call => \&mydelete);
hook(type => "change", id => "po", call => \&change);
hook(type => "canremove", id => "po", call => \&canremove);
+ hook(type => "canrename", id => "po", call => \&canrename);
hook(type => "editcontent", id => "po", call => \&editcontent);
$origsubs{'bestlink'}=\&IkiWiki::bestlink;
@@ -417,6 +418,16 @@ sub canremove ($$$) {
return undef;
}
+sub canrename ($$$) {
+ my ($page, $cgi, $session) = (shift, shift, shift);
+
+ if (istranslation($page)) {
+ return gettext("Can not rename a translation. Renaming the master page,".
+ "though, renames its translations as well.");
+ }
+ return undef;
+}
+
# As we're previewing or saving a page, the content may have
# changed, so tell the next filter() invocation it must not be lazy.
sub editcontent () {