three new hooks in SpecialUndelete.php from Wikia codebase so that extensions, such...
authorJack Phoenix <ashley@users.mediawiki.org>
Mon, 16 May 2011 13:30:32 +0000 (13:30 +0000)
committerJack Phoenix <ashley@users.mediawiki.org>
Mon, 16 May 2011 13:30:32 +0000 (13:30 +0000)
RELEASE-NOTES-1.19
docs/hooks.txt
includes/specials/SpecialUndelete.php

index 97e2f8b..74aa2df 100644 (file)
@@ -28,6 +28,10 @@ production.
 * Images can now be embedded in an XML dump stream using backupDump.php 
   --include-files and can be imported using importDump.php --uploads; 
   furthermore, it can import files from the filesystem using --image-base-path
+* Three new hooks in Special:Undelete, 'UndeleteForm::showHistory',
+  'UndeleteForm::showRevision' and 'UndeleteForm::undelete', so that extensions
+  may override the usage of PageArchive class and replace it with their own
+  class that extends PageArchive
 
 === Bug fixes in 1.19 ===
 * (bug 10154) Don't allow user to specify days beyond $wgRCMaxAge.
index 2a7976b..2be47a8 100644 (file)
@@ -1706,6 +1706,23 @@ $user: user who did the move
 $pageid: database ID of the page that's been moved
 $redirid: database ID of the created redirect
 
+'UndeleteForm::showHistory': called in UndeleteForm::showHistory, after a
+PageArchive object has been created but before any further processing is done.
+&$archive: PageArchive object
+$title: Title object of the page that we're viewing
+
+'UndeleteForm::showRevision': called in UndeleteForm::showRevision, after a
+PageArchive object has been created but before any further processing is done.
+&$archive: PageArchive object
+$title: Title object of the page that we're viewing
+
+'UndeleteForm::undelete': called un UndeleteForm::undelete, after checking that
+the site is not in read-only mode, that the Title object is not null and after
+a PageArchive object has been constructed but before performing any further
+processing.
+&$archive: PageArchive object
+$title: Title object of the page that we're about to undelete
+
 'UndeleteShowRevision': called when showing a revision in Special:Undelete
 $title: title object related to the revision
 $rev: revision (object) that will be viewed
index e0f7767..3795e7d 100644 (file)
@@ -769,6 +769,7 @@ class SpecialUndelete extends SpecialPage {
                }
 
                $archive = new PageArchive( $this->mTargetObj );
+               wfRunHooks( 'UndeleteForm::showRevision', array( &$archive, $this->mTargetObj ) );
                $rev = $archive->getRevision( $timestamp );
 
                if( !$rev ) {
@@ -1062,6 +1063,7 @@ class SpecialUndelete extends SpecialPage {
                );
 
                $archive = new PageArchive( $this->mTargetObj );
+               wfRunHooks( 'UndeleteForm::showHistory', array( &$archive, $this->mTargetObj ) );
                /*
                $text = $archive->getLastRevisionText();
                if( is_null( $text ) ) {
@@ -1421,6 +1423,7 @@ class SpecialUndelete extends SpecialPage {
                }
                if( !is_null( $this->mTargetObj ) ) {
                        $archive = new PageArchive( $this->mTargetObj );
+                       wfRunHooks( 'UndeleteForm::undelete', array( &$archive, $this->mTargetObj ) );
                        $ok = $archive->undelete(
                                $this->mTargetTimestamp,
                                $this->mComment,