From 2d5230dc1539562be372e2823ff7d7faa8c3e0cf Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 18 Jan 2007 07:44:25 +0000 Subject: [PATCH] * (bug 8136) Introduce 'ArticleUndelete' hook; see docs/hooks.txt for more info --- RELEASE-NOTES | 2 +- docs/hooks.txt | 5 +++++ includes/SpecialUndelete.php | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4a7a894bb2..688cfafc87 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -119,7 +119,7 @@ lighter making things easier to read. * Ignore self closing on closing tags ( '' now gives '') * (bug 8673) Minor fix for web service API content-type header * Fix API revision list on PHP 5.2.1; bad reference assignment - +* (bug 8136) Introduce 'ArticleUndelete' hook; see docs/hooks.txt for more info == Languages updated == diff --git a/docs/hooks.txt b/docs/hooks.txt index a0b963c7c2..347ad5baa7 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -286,6 +286,11 @@ $isminor: minor flag $iswatch: watch flag $section: section # +'ArticleUndeleted': When one or more revisions of an article are restored +$title: Title corresponding to the article restored +$create: Whether or not the restoration caused the page to be created +(i.e. it didn't exist before) + 'AuthPluginSetup': update or replace authentication plugin object ($wgAuth) Gives a chance for an extension to set it programattically to a variable class. &$auth: the $wgAuth object, probably a stub diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 888661b287..a837eafb08 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -431,8 +431,10 @@ class PageArchive { } if( $newid ) { + wfRunHooks( 'ArticleUndelete', array( &$this->title, true ) ); Article::onArticleCreate( $this->title ); } else { + wfRunHooks( 'ArticleUndelete', array( &$this->title, false ) ); Article::onArticleEdit( $this->title ); } } else { -- 2.20.1