diff options
author | intrigeri <intrigeri@boum.org> | 2009-01-27 16:57:52 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-01-27 17:08:55 +0100 |
commit | 51badc960d933f6d0670cc76390c332a31b35d63 (patch) | |
tree | 6adcb19e6f07399791ca150a19b0ad7acca89817 /doc/plugins | |
parent | 58481dcdf623aed8ab840ab86e3ac065c4bcb8a1 (diff) |
rename hook: instead of modifying the passed-by-name array, return a copy
This is intended to solve Joey's concerns expressed on
http://ikiwiki.info/todo/need_global_renamepage_hook/, i.e. the need to make it
possible to use this hook from external plugins.
A plugin using this hook still can add/modify/remove elements of the
@torename array.
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'doc/plugins')
-rw-r--r-- | doc/plugins/write.mdwn | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 98372b33d..0c5ad4540 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -414,16 +414,16 @@ new page. ### rename - hook(type => "rename", id => "foo", call => \&renamepages); + hook(type => "rename", id => "foo", call => \&rename); When a page or set of pages is renamed, the referenced function is -called, and is passed: +called, and is passed named parameters: -* 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 +* `torename`: a reference to an array of hashes with keys: `src`, `srcfile`, + `dest`, `destfile`, `required`. Such a hook function can either return the + array content unchanged, or modify it and return the modified version. +* `cgi`: a CGI object +* `session`: a session object. ### getsetup |