(bug 6184) Use shinier Linker::userLink() to make user links in Special:Undelete
authorRob Church <robchurch@users.mediawiki.org>
Sat, 3 Jun 2006 12:57:51 +0000 (12:57 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 3 Jun 2006 12:57:51 +0000 (12:57 +0000)
RELEASE-NOTES
includes/SpecialUndelete.php

index 993e0f5..fcb2edf 100644 (file)
@@ -416,7 +416,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   tag. The sanitizer still needs to learn how to make well-formed XML
   in this case.
 * Fix fatal error when specifying illegal name for manual thumbnail
-
+* (bug 6184) Use shinier Linker::userLink() to make user links in Special:Undelete
 
 == Compatibility ==
 
index 1e917da..eff9c25 100644 (file)
@@ -474,6 +474,17 @@ class UndeleteForm {
 
                # List all stored revisions
                $revisions = $archive->listRevisions();
+               
+               # Batch existence check on user and talk pages
+               if( $revisions->numRows() > 0 ) {
+                       $batch = new LinkBatch();
+                       while( $row = $revisions->fetchObject() ) {
+                               $batch->addObj( Title::makeTitleSafe( NS_USER, $row->ar_user_text ) );
+                               $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->ar_user_text ) );
+                       }
+                       $batch->execute();
+                       $revisions->seek( 0 );
+               }
 
                if ( $this->mAllowed ) {
                        $titleObj = Title::makeTitle( NS_SPECIAL, "Undelete" );
@@ -496,12 +507,9 @@ class UndeleteForm {
                $wgOut->addHTML( "<h2>" . htmlspecialchars( wfMsg( "history" ) ) . "</h2>\n" );
                
                if( $this->mAllowed ) {
-                       # Brief explanation of how it all works
-                       $wgOut->addHtml( '<fieldset>' );
-                       #$wgOut->addWikiText( wfMsg( 'undeleteextrahelp' ) );
                        # Format the user-visible controls (comment field, submission button)
                        # in a nice little table
-                       $table = '<table><tr>';
+                       $table = '<fieldset><table><tr>';
                        $table .= '<td colspan="2">' . wfMsgWikiHtml( 'undeleteextrahelp' ) . '</td></tr><tr>';
                        $table .= '<td align="right"><strong>' . wfMsgHtml( 'undeletecomment' ) . '</strong></td>';
                        $table .= '<td>' . wfInput( 'wpComment', 50, $this->mComment ) . '</td>';
@@ -526,16 +534,7 @@ class UndeleteForm {
                                $checkBox = '';
                                $pageLink = $wgLang->timeanddate( $ts, true );
                        }
-                       $userLink = htmlspecialchars( $row->ar_user_text );
-                       if( $row->ar_user ) {
-                               $userLink = $sk->makeKnownLinkObj(
-                                       Title::makeTitle( NS_USER, $row->ar_user_text ),
-                                       $userLink );
-                       } else {
-                               $userLink = $sk->makeKnownLinkObj(
-                                       Title::makeTitle( NS_SPECIAL, 'Contributions' ),
-                                       $userLink, 'target=' . $row->ar_user_text );
-                       }
+                       $userLink = $sk->userLink( $row->ar_user, $row->ar_user_text );
                        $comment = $sk->commentBlock( $row->ar_comment );
                        $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );