From: umherirrender Date: Fri, 6 Jul 2012 21:48:08 +0000 (+0200) Subject: Add userToolLinks on Special:FileDuplicateSearch X-Git-Tag: 1.31.0-rc.0~23048^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=cf48e2166866d5df9ab2d884a2ffadf93be60088;p=lhc%2Fweb%2Fwiklou.git Add userToolLinks on Special:FileDuplicateSearch Adding LinkBatch for the file, user and user talk links Also not linking to user of the foreign wiki, because that can bring problems, when the user is not the same as the user on this wiki. ImagePage.php is that already doing when showing the file history. Change-Id: I72f94db11e7346036e53cddbe431d009de6ba2d3 --- diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 18d19db80b..f8e40e0f40 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -157,10 +157,24 @@ class FileDuplicateSearchPage extends QueryPage { ); } + $this->doBatchLookups( $dupes ); $this->showList( $dupes ); } } + function doBatchLookups( $list ) { + $batch = new LinkBatch(); + foreach( $list as $file ) { + $batch->addObj( $file->getTitle() ); + if( $file->isLocal() ) { + $userName = $file->getUser( 'text' ); + $batch->add( NS_USER, $userName ); + $batch->add( NS_USER_TALK, $userName ); + } + } + $batch->execute(); + } + /** * * @param Skin $skin @@ -178,7 +192,17 @@ class FileDuplicateSearchPage extends QueryPage { ); $userText = $result->getUser( 'text' ); - $user = Linker::link( Title::makeTitle( NS_USER, $userText ), $userText ); + if ( $result->isLocal() ) { + $userId = $result->getUser( 'id' ); + $user = Linker::userLink( $userId, $userText ); + $user .= $this->getContext()->msg( 'word-separator' )->plain(); + $user .= ''; + $user .= Linker::userToolLinks( $userId, $userText ); + $user .= ''; + } else { + $user = htmlspecialchars( $userText ); + } + $time = $this->getLanguage()->userTimeAndDate( $result->getTimestamp(), $this->getUser() ); return "$plink . . $user . . $time";