Table of Contents
- intercept page writes
- writes a wiki page to disk
The event is signalled by io_writeWikiPage() in inc/io.php.
The page content may be modified by action plugins between DokuWiki and the disk.
Page creation may be detected by checking if the file already exists and the revision is false.
Page deletion may be detected by checking for empty page content. On update to an existing page this event is called twice, once for the transfer of the old version to the attic (rev will have a value) and once to write the new version of the page into the wiki (rev is false)
The passed Doku_Event object has the fields
$data field is an array with the entries:
- $data – The raw arguments for io_saveFile() as an array. Do not change file path.
- $data – the file path.
- $data – the content to be saved, and may be modified.
- $data – whether given content will be appended, default false.
- $data – ns: The colon separated namespace path minus the trailing page name. (false if root ns)
- $data – page_name: The wiki page name.
- $data – rev: The page revision, false for current wiki pages.
In the BEFORE event handler the
$data can be modified, for example to modify the content.
In the AFTER event handler the
$result field is available with the boolean result (success or fail) of the _io_writeWikiPage_action() method.
- Code related to this event used in any DokuWiki's files, plugins and templates