summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/po.pm9
-rw-r--r--IkiWiki/Plugin/rename.pm3
-rw-r--r--doc/plugins/write.mdwn6
3 files changed, 12 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index cb48aaf0d..c0c7557e4 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -432,11 +432,12 @@ sub canremove ($$$) {
return undef;
}
-sub canrename ($$$) {
- my ($page, $cgi, $session) = (shift, shift, shift);
+sub canrename ($$@) {
+ my ($cgi, $session) = (shift, shift);
+ my %params = @_;
- if (istranslation($page)) {
- my $masterpage = masterpage($page);
+ if (istranslation($params{src})) {
+ my $masterpage = masterpage($params{src});
# Tell the difference between:
# - a translation being renamed as a consequence of its master page
# being renamed, which is allowed
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index 5c198f457..82639a073 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -91,7 +91,8 @@ sub check_canrename ($$$$$$) {
my $canrename;
IkiWiki::run_hooks(canrename => sub {
return if defined $canrename;
- my $ret=shift->($src, $q, $session);
+ my $ret=shift->($q, $session, src => $src, srcfile => $srcfile,
+ dest => $dest, destfile => $destfile);
if (defined $ret) {
if ($ret eq "") {
$canrename=1;
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index a1e14cb94..92e372cfa 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -335,7 +335,11 @@ bypass it). It works exactly like the `canedit` hook.
This hook can be used to implement arbitrary access methods to control when
a page can be renamed using the web interface (commits from revision control
-bypass it). It works exactly like the `canedit` hook.
+bypass it). It works exactly like the `canedit` and `canremove` hook,
+but is passed:
+* a CGI object
+* a session object
+* the named parameters `src`, `srcfile`, `dest` and `destfile`.
### editcontent