diff options
author | intrigeri <intrigeri@boum.org> | 2009-03-08 11:44:00 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-03-08 11:44:00 +0100 |
commit | 8cfe428a28b2714c57282566466f4f7bdbdfdffb (patch) | |
tree | 3548f3deab8249300ae72813f3ee5399db715377 /doc/plugins | |
parent | ae474d8e14631ff519ed7d54bb64eaa0538f56d9 (diff) |
rename hook: run once per file to be renamed
... as Joey suggested on todo/need_global_renamepage_hook
This hook is applied recursively to returned additional rename
hashes, so that it handles the case where two plugins use the hook:
plugin A would see when plugin B adds a new file to be renamed.
The full set of rename hashes can no longer be changed by hook functions, that
are only allowed to return any additional rename hashes it wants to add.
Rationale: the correct behavior of the recursion would be hard, if not
impossible, to define, if already considered pages were changing on the run.
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'doc/plugins')
-rw-r--r-- | doc/plugins/write.mdwn | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index be01605e8..cccfb9bba 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -422,14 +422,18 @@ new page. hook(type => "rename", id => "foo", call => \&rename); When a page or set of pages is renamed, the referenced function is -called, and is passed named parameters: +called for every page, and is passed named parameters: -* `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. +* `torename`: a reference to a hash with keys: `src`, `srcfile`, + `dest`, `destfile`, `required`. * `cgi`: a CGI object * `session`: a session object. +Such a hook function returns any additional rename hashes it wants to +add. This hook is applied recursively to returned additional rename +hashes, so that it handles the case where two plugins use the hook: +plugin A would see when plugin B adds a new file to be renamed. + ### getsetup hook(type => "getsetup", id => "foo", call => \&getsetup); |