From: Jack Phoenix Date: Mon, 16 May 2011 13:30:32 +0000 (+0000) Subject: three new hooks in SpecialUndelete.php from Wikia codebase so that extensions, such... X-Git-Tag: 1.31.0-rc.0~30127 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=9a4d62c4f52d322f77e6eed55a3034d1091b9f9e;p=lhc%2Fweb%2Fwiklou.git three new hooks in SpecialUndelete.php from Wikia codebase so that extensions, such as the Video extension, can use their custom PageArchive class --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 97e2f8bd02..74aa2df105 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/docs/hooks.txt b/docs/hooks.txt index 2a7976bc60..2be47a80a0 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index e0f77679f7..3795e7d681 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -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,