From: intrigeri Date: Thu, 1 Jan 2009 16:47:20 +0000 (+0100) Subject: rename: pass the CGI and session to the rename hook X-Git-Tag: 3.15~297 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a8105f68590c7aa56fc37ec62df854546a119060;p=ikiwiki.git rename: pass the CGI and session to the rename hook The po plugin remame + canrename hook combination will need this. Signed-off-by: intrigeri --- diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 740ca8ac4..5c198f457 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -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) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index a927b1629..a1e14cb94 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -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