*Add hook when a revision is restored (for flaggedrevs, next commit)
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 7 Dec 2007 22:51:00 +0000 (22:51 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 7 Dec 2007 22:51:00 +0000 (22:51 +0000)
docs/hooks.txt
includes/SpecialUndelete.php

index 6330f79..65aa2db 100644 (file)
@@ -325,6 +325,11 @@ $moveonly: boolean whether it was for move only or not
 'ArticlePurge': before executing "&action=purge" 
 $article: article (object) to purge
 
+'ArticleRevisionUndeleted' after an article revision is restored
+$title: the article title
+$revision: the revision
+$oldPageID: the page ID of the revision when archived (may be null)
+
 'ArticleRollbackComplete': after an article rollback is completed
 $article: the article that was edited
 $user: the user who did the rollback
index 06d66a2..1fe11c1 100644 (file)
@@ -432,6 +432,7 @@ class PageArchive {
                                'ar_minor_edit',
                                'ar_flags',
                                'ar_text_id',
+                               'ar_page_id',
                                'ar_len' ),
                        /* WHERE */ array(
                                'ar_namespace' => $this->title->getNamespace(),
@@ -476,6 +477,8 @@ class PageArchive {
                                ) );
                        $revision->insertOn( $dbw );
                        $restored++;
+                       
+                       wfRunHooks( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) );
                }
                // Was anything restored at all?
                if($restored == 0)