http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88235
Revision: 88235
Author: ashley
Date: 2011-05-16 13:30:32 +0000 (Mon, 16 May 2011)
Log Message:
-----------
three new hooks in SpecialUndelete.php from Wikia codebase so that extensions,
such as the Video extension, can use their custom PageArchive class
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES-1.19
trunk/phase3/docs/hooks.txt
trunk/phase3/includes/specials/SpecialUndelete.php
Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19 2011-05-16 13:15:15 UTC (rev 88234)
+++ trunk/phase3/RELEASE-NOTES-1.19 2011-05-16 13:30:32 UTC (rev 88235)
@@ -28,6 +28,10 @@
* 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.
Modified: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt 2011-05-16 13:15:15 UTC (rev 88234)
+++ trunk/phase3/docs/hooks.txt 2011-05-16 13:30:32 UTC (rev 88235)
@@ -1706,6 +1706,23 @@
$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
Modified: trunk/phase3/includes/specials/SpecialUndelete.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUndelete.php 2011-05-16 13:15:15 UTC
(rev 88234)
+++ trunk/phase3/includes/specials/SpecialUndelete.php 2011-05-16 13:30:32 UTC
(rev 88235)
@@ -769,6 +769,7 @@
}
$archive = new PageArchive( $this->mTargetObj );
+ wfRunHooks( 'UndeleteForm::showRevision', array( &$archive,
$this->mTargetObj ) );
$rev = $archive->getRevision( $timestamp );
if( !$rev ) {
@@ -1062,6 +1063,7 @@
);
$archive = new PageArchive( $this->mTargetObj );
+ wfRunHooks( 'UndeleteForm::showHistory', array( &$archive,
$this->mTargetObj ) );
/*
$text = $archive->getLastRevisionText();
if( is_null( $text ) ) {
@@ -1421,6 +1423,7 @@
}
if( !is_null( $this->mTargetObj ) ) {
$archive = new PageArchive( $this->mTargetObj );
+ wfRunHooks( 'UndeleteForm::undelete', array( &$archive,
$this->mTargetObj ) );
$ok = $archive->undelete(
$this->mTargetTimestamp,
$this->mComment,
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs