DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:io_wikipage_write

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
devel:event:io_wikipage_write [2010-09-19 22:07] – [Passed Data] 151.57.14.118devel:event:io_wikipage_write [2014-12-02 15:37] – [Passed Data] Klap-in
Line 16: Line 16:
 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) 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)
 ===== Passed Data ===== ===== Passed Data =====
 +The passed [[xref>Doku_Event]] object has the fields ''$data'' and ''$result''.
  
-  * $data[0] --   The raw arguments for io_saveFile as an array. Do not change file path.+The ''$data'' field is an array with the entries: 
 +  * $data[0] --   The raw arguments for [[xref>io_saveFile()]] as an array. Do not change file path.
     * $data[0][0] -- the file path.     * $data[0][0] -- the file path.
     * $data[0][1] -- the content to be saved, and may be modified.      * $data[0][1] -- the content to be saved, and may be modified. 
 +    * $data[0][2] -- whether given content will be appended, default false.
   * $data[1] --   ns: The colon separated namespace path minus the trailing page name. (false if root ns)   * $data[1] --   ns: The colon separated namespace path minus the trailing page name. (false if root ns)
   * $data[2] --   page_name: The wiki page name.   * $data[2] --   page_name: The wiki page name.
   * $data[3] --   rev: The page revision, false for current wiki pages.   * $data[3] --   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 [[xref>_io_writeWikiPage_action()]] method.
  
 ===== Plugins handling this event ===== ===== Plugins handling this event =====
Line 28: Line 35:
 The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself. The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.
  
-  * [[plugin:data]], [[plugin:distributedacl]], [[plugin:indexmenu]], [[plugin:publish]], [[plugin:tag]], [[plugin:underconstruction]], [[plugin:wikisign]], [[plugin:wysiwyg]]+  * [[plugin:data]], [[plugin:distributedacl]], [[plugin:geotag]], [[plugin:indexmenu]], [[plugin:publish]], [[plugin:tag]], [[plugin:underconstruction]], [[plugin:wikisign]], [[plugin:wysiwyg]]
  
 ===== See also ===== ===== See also =====
devel/event/io_wikipage_write.txt · Last modified: 2018-12-08 15:46 by torpedo

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki