From 51badc960d933f6d0670cc76390c332a31b35d63 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 27 Jan 2009 16:57:52 +0100 Subject: 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 --- doc/plugins/write.mdwn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc/plugins') 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 -- cgit v1.2.3