add SpecialUndeleteLogEntry hook
authoraude <aude.wiki@gmail.com>
Fri, 16 Nov 2012 17:10:53 +0000 (17:10 +0000)
committeraude <aude.wiki@gmail.com>
Mon, 19 Nov 2012 10:23:21 +0000 (10:23 +0000)
- allows extensions to perform some action at time that a undeletion log entry is performed,
or skip the insertion of a log entry.

Change-Id: I5b0caaddfe5d7262612a60946d9f5c4af2679141

docs/hooks.txt
includes/specials/SpecialUndelete.php

index 67b4580..5116dda 100644 (file)
@@ -578,6 +578,11 @@ $create: Whether or not the restoration caused the page to be created
 (i.e. it didn't exist before)
 $comment: The comment associated with the undeletion.
 
+'ArticleUndeleteLogEntry': When a log entry is generated but not yet saved.
+$pageArchive: the PageArchive object
+&$logEntry: ManualLogEntry object
+$user: User who is performing the log action
+
 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save),
 before the user is redirected back to the page
 &$article: the article
index c0420e5..0d2ac7e 100644 (file)
@@ -417,6 +417,9 @@ class PageArchive {
                $logEntry->setPerformer( $user );
                $logEntry->setTarget( $this->title );
                $logEntry->setComment( $reason );
+
+               wfRunHooks( 'ArticleUndeleteLogEntry', array( $this, &$logEntry, $user ) );
+
                $logid = $logEntry->insert();
                $logEntry->publish( $logid );