rename: pass the CGI and session to the rename hook
authorintrigeri <intrigeri@boum.org>
Thu, 1 Jan 2009 16:47:20 +0000 (17:47 +0100)
committerintrigeri <intrigeri@boum.org>
Thu, 1 Jan 2009 16:47:20 +0000 (17:47 +0100)
The po plugin remame + canrename hook combination will need this.

Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/rename.pm
doc/plugins/write.mdwn

index 740ca8ac443f72ba05336599da5a331d1157f55e..5c198f45721b5f441325dd8f44aed276253b53d1 100644 (file)
@@ -311,7 +311,7 @@ sub sessioncgi ($$) {
                                required => 1,
                        };
 
-                       IkiWiki::run_hooks(rename => sub { shift->(\@torename); });
+                       IkiWiki::run_hooks(rename => sub { shift->(\@torename, $q, $session); });
 
                        # See if any subpages need to be renamed.
                        if ($q->param("subpages") && $src ne $dest) {
index a927b16293f549a0ec94be8177229c4f54f8a22a..a1e14cb948989fe82f14eb54b8267aeec7975d23 100644 (file)
@@ -392,9 +392,13 @@ new page.
        hook(type => "rename", id => "foo", call => \&renamepages);
 
 When a page or set of pages is renamed, the referenced function is
-called, and passed a reference to an array of hashes with keys:
-`src`, `srcfile`, `dest`, `destfile`, `required`. It can modify
-the array.
+called, and is passed:
+
+* a reference to an array of hashes with keys: `src`, `srcfile`,
+  `dest`, `destfile`, `required`. Such a hook function can modify
+  the array.
+* a CGI object
+* a session object
 
 ### getsetup