+
+ my $canrename;
+ IkiWiki::run_hooks(canrename => sub {
+ return if defined $canrename;
+ my $ret=shift->($q, $session, src => $src, srcfile => $srcfile,
+ dest => $dest, destfile => $destfile);
+ if (defined $ret) {
+ if ($ret eq "") {
+ $canrename=1;
+ }
+ elsif (ref $ret eq 'CODE') {
+ $ret->();
+ $canrename=0;
+ }
+ elsif (defined $ret) {
+ error($ret);
+ $canrename=0;
+ }
+ }
+ });
+ return $canrename;