Slowly merge in a few rev_deleted checks
[lhc/web/wiklou.git] / includes / SpecialUndelete.php
index c08a777..51b71d0 100644 (file)
@@ -499,6 +499,11 @@ class PageArchive {
                                wfRunHooks( 'ArticleUndelete', array( &$this->title, false ) );
                                Article::onArticleEdit( $this->title );
                        }
+
+                       if( $this->title->getNamespace() == NS_IMAGE ) {
+                               $update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
+                               $update->doUpdate();
+                       }
                } else {
                        // Revision couldn't be created. This is very weird
                        return self::UNDELETE_UNKNOWNERR;
@@ -609,7 +614,7 @@ class UndeleteForm {
 
        function showSearchForm() {
                global $wgOut, $wgScript;
-               $wgOut->addWikiText( wfMsg( 'undelete-header' ) );
+               $wgOut->addWikiMsg( 'undelete-header' );
                
                $wgOut->addHtml(
                        Xml::openElement( 'form', array(
@@ -632,11 +637,11 @@ class UndeleteForm {
                global $wgLang, $wgContLang, $wgUser, $wgOut;
                
                if( $result->numRows() == 0 ) {
-                       $wgOut->addWikiText( wfMsg( 'undelete-no-results' ) );
+                       $wgOut->addWikiMsg( 'undelete-no-results' );
                        return;
                }
 
-               $wgOut->addWikiText( wfMsg( "undeletepagetext" ) );
+               $wgOut->addWikiMsg( "undeletepagetext" );
 
                $sk = $wgUser->getSkin();
                $undelete = SpecialPage::getTitleFor( 'Undelete' );
@@ -667,7 +672,7 @@ class UndeleteForm {
                $rev = $archive->getRevision( $timestamp );
                
                if( !$rev ) {
-                       $wgOut->addWikiTexT( wfMsg( 'undeleterevision-missing' ) );
+                       $wgOut->addWikiMsg( 'undeleterevision-missing' );
                        return;
                }
                
@@ -837,14 +842,14 @@ class UndeleteForm {
                /*
                $text = $archive->getLastRevisionText();
                if( is_null( $text ) ) {
-                       $wgOut->addWikiText( wfMsg( "nohistory" ) );
+                       $wgOut->addWikiMsg( "nohistory" );
                        return;
                }
                */
                if ( $this->mAllowed ) {
-                       $wgOut->addWikiText( wfMsg( "undeletehistory" ) );
+                       $wgOut->addWikiMsg( "undeletehistory" );
                } else {
-                       $wgOut->addWikiText( wfMsg( "undeletehistorynoadmin" ) );
+                       $wgOut->addWikiMsg( "undeletehistorynoadmin" );
                }
 
                # List all stored revisions
@@ -978,7 +983,7 @@ class UndeleteForm {
                        $revisions->free();
                        $wgOut->addHTML("</ul>");
                } else {
-                       $wgOut->addWikiText( wfMsg( "nohistory" ) );
+                       $wgOut->addWikiMsg( "nohistory" );
                }
 
                if( $haveFiles ) {
@@ -1050,6 +1055,11 @@ class UndeleteForm {
                                $this->mFileVersions );
 
                        if( is_array($ok) ) {
+                               if ( $ok[1] ) // Undeleted file count
+                                       wfRunHooks( 'FileUndeleteComplete', array(
+                                               $this->mTargetObj, $this->mFileVersions, 
+                                               $wgUser, $this->mComment) );
+                       
                                $skin = $wgUser->getSkin();
                                $link = $skin->makeKnownLinkObj( $this->mTargetObj );
                                $wgOut->addHtml( wfMsgWikiHtml( 'undeletedpage', $link ) );