Jump to content

Wikia code/includes/specials/SpecialUndelete.php

From mediawiki.org
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\specials\SpecialUndelete.php	2011-07-18 22:31:17.643554700 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\specials\SpecialUndelete.php	2011-08-17 15:28:16.285156200 +0100
@@ -315,6 +315,7 @@
 	 * on success, false on failure
 	 */
 	function undelete( $timestamps, $comment = '', $fileVersions = array(), $unsuppress = false ) {
+		global $wgUser;
 		// If both the set of text revisions and file revisions are empty,
 		// restore everything. Otherwise, just restore the requested items.
 		$restoreAll = empty( $timestamps ) && empty( $fileVersions );
@@ -361,6 +362,8 @@
 			$reason .= wfMsgForContent( 'colon-separator' ) . $comment;
 		$log->addEntry( 'restore', $this->title, $reason );
 
+		wfRunHooks( 'UndeleteComplete', array(&$this->title, &$wgUser, $reason ) );
+
 		return array($textRestored, $filesRestored, $reason);
 	}
 
@@ -731,6 +735,9 @@
 		if(!preg_match("/[0-9]{14}/",$timestamp)) return 0;
 
 		$archive = new PageArchive( $this->mTargetObj );
+		// added by Bartek 12.05.09 for RT #12614
+		wfRunHooks( 'UndeleteForm::showRevision', array( &$archive, $this->mTargetObj ) );
+
 		$rev = $archive->getRevision( $timestamp );
 
 		if( !$rev ) {
@@ -997,6 +1004,9 @@
 		$wgOut->wrapWikiMsg(  "<div class='mw-undelete-pagetitle'>\n$1</div>\n", array ( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() ) );
 
 		$archive = new PageArchive( $this->mTargetObj );
+		// added by Bartek 12.05.09 for RT #12614
+		wfRunHooks( 'UndeleteForm::showHistory', array( &$archive, $this->mTargetObj ) );
+
 		/*
 		$text = $archive->getLastRevisionText();
 		if( is_null( $text ) ) {
@@ -1357,6 +1367,9 @@
 		}
 		if( !is_null( $this->mTargetObj ) ) {
 			$archive = new PageArchive( $this->mTargetObj );
+			// added by Bartek 12.05.09 for RT #12614
+			wfRunHooks( 'UndeleteForm::undelete', array( &$archive, $this->mTargetObj ) );
+
 			$ok = $archive->undelete(
 				$this->mTargetTimestamp,
 				$this->mComment,