From 307253286cdb2153607d0a29a9675f3bfc25a456 Mon Sep 17 00:00:00 2001 From: Gabriel Birke Date: Fri, 21 Dec 2007 16:01:30 +0100 Subject: Trigger IO_WIKIPAGE_WRITE on page delete DokuWiki will fire two IO_WIKIPAGE_WRITE events instead of one when a page is deleted. The first event has no revision and empty text in the data. Now the code conforms with the documentation at http://wiki.splitbrain.org/wiki:events_list#io_wikipage_write Now action plugins can act on page delete. darcs-hash:20071221150130-79ce3-51092d13c2e29285e5580f704f409f25563134c6.gz --- inc/common.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index ec500d906..866c64b8c 100644 --- a/inc/common.php +++ b/inc/common.php @@ -787,6 +787,9 @@ function saveWikiText($id,$text,$summary,$minor=false){ } if ($wasRemoved){ + // Send "update" event with empty data, so plugins can react to page deletion + $data = array(array($file, '', false), getNS($id), noNS($id), false); + trigger_event('IO_WIKIPAGE_WRITE', $data); // pre-save deleted revision @touch($file); clearstatcache(); -- cgit v1.2.3