From 58bd2adb3d82d57484baf00c433f4bfc05fcd831 Mon Sep 17 00:00:00 2001 From: aude Date: Fri, 16 Nov 2012 17:10:53 +0000 Subject: [PATCH] add SpecialUndeleteLogEntry hook - 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 | 5 +++++ includes/specials/SpecialUndelete.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index 67b4580b75..5116ddad32 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index c0420e56c2..0d2ac7eb8d 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -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 ); -- 2.20.1