From: aude Date: Fri, 16 Nov 2012 17:10:53 +0000 (+0000) Subject: add SpecialUndeleteLogEntry hook X-Git-Tag: 1.31.0-rc.0~21585^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=58bd2adb3d82d57484baf00c433f4bfc05fcd831;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );