From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/specials/SpecialFileDuplicateSearch.php | 49 +++++++++++------------- 1 file changed, 23 insertions(+), 26 deletions(-) (limited to 'includes/specials/SpecialFileDuplicateSearch.php') diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index a296fd95..18d19db8 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -62,19 +62,16 @@ class FileDuplicateSearchPage extends QueryPage { * @param $dupes Array of File objects */ function showList( $dupes ) { - global $wgOut; - $skin = $this->getSkin(); - $html = array(); $html[] = $this->openList( 0 ); foreach ( $dupes as $dupe ) { - $line = $this->formatResult( $skin, $dupe ); + $line = $this->formatResult( null, $dupe ); $html[] = "
  • " . $line . "
  • "; } $html[] = $this->closeList(); - $wgOut->addHtml( implode( "\n", $html ) ); + $this->getOutput()->addHtml( implode( "\n", $html ) ); } function getQueryInfo() { @@ -91,12 +88,12 @@ class FileDuplicateSearchPage extends QueryPage { } function execute( $par ) { - global $wgRequest, $wgOut, $wgLang, $wgScript; + global $wgScript; $this->setHeaders(); $this->outputHeader(); - $this->filename = isset( $par ) ? $par : $wgRequest->getText( 'filename' ); + $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' ); $this->file = null; $this->hash = ''; $title = Title::newFromText( $this->filename, NS_FILE ); @@ -104,14 +101,16 @@ class FileDuplicateSearchPage extends QueryPage { $this->file = wfFindFile( $title ); } + $out = $this->getOutput(); + # Create the input form - $wgOut->addHTML( + $out->addHTML( Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsg( 'fileduplicatesearch-legend' ) ) . - Xml::inputLabel( wfMsg( 'fileduplicatesearch-filename' ), 'filename', 'filename', 50, $this->filename ) . ' ' . - Xml::submitButton( wfMsg( 'fileduplicatesearch-submit' ) ) . + Xml::element( 'legend', null, $this->msg( 'fileduplicatesearch-legend' )->text() ) . + Xml::inputLabel( $this->msg( 'fileduplicatesearch-filename' )->text(), 'filename', 'filename', 50, $this->filename ) . ' ' . + Xml::submitButton( $this->msg( 'fileduplicatesearch-submit' )->text() ) . Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) ); @@ -119,7 +118,7 @@ class FileDuplicateSearchPage extends QueryPage { if( $this->file ) { $this->hash = $this->file->getSha1(); } elseif( $this->filename !== '' ) { - $wgOut->wrapWikiMsg( + $out->wrapWikiMsg( "

    \n$1\n

    ", array( 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) ) ); @@ -131,14 +130,12 @@ class FileDuplicateSearchPage extends QueryPage { if ( $img ) { $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) ); if( $thumb ) { - $wgOut->addHTML( '
    ' . + $out->addHTML( '
    ' . $thumb->toHtml( array( 'desc-link' => false ) ) . '
    ' . - wfMsgExt( 'fileduplicatesearch-info', array( 'parse' ), - $wgLang->formatNum( $img->getWidth() ), - $wgLang->formatNum( $img->getHeight() ), - $wgLang->formatSize( $img->getSize() ), - $img->getMimeType() - ) . + $this->msg( 'fileduplicatesearch-info' )->numParams( + $img->getWidth(), $img->getHeight() )->params( + $this->getLanguage()->formatSize( $img->getSize() ), + $img->getMimeType() )->parseAsBlock() . '
    ' ); } } @@ -148,15 +145,15 @@ class FileDuplicateSearchPage extends QueryPage { # Show a short summary if( $numRows == 1 ) { - $wgOut->wrapWikiMsg( + $out->wrapWikiMsg( "

    \n$1\n

    ", array( 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) ) ); } elseif ( $numRows ) { - $wgOut->wrapWikiMsg( + $out->wrapWikiMsg( "

    \n$1\n

    ", array( 'fileduplicatesearch-result-n', wfEscapeWikiText( $this->filename ), - $wgLang->formatNum( $numRows - 1 ) ) + $this->getLanguage()->formatNum( $numRows - 1 ) ) ); } @@ -171,18 +168,18 @@ class FileDuplicateSearchPage extends QueryPage { * @return string */ function formatResult( $skin, $result ) { - global $wgContLang, $wgLang; + global $wgContLang; $nt = $result->getTitle(); $text = $wgContLang->convert( $nt->getText() ); - $plink = $skin->link( + $plink = Linker::link( Title::newFromText( $nt->getPrefixedText() ), $text ); $userText = $result->getUser( 'text' ); - $user = $skin->link( Title::makeTitle( NS_USER, $userText ), $userText ); - $time = $wgLang->timeanddate( $result->getTimestamp() ); + $user = Linker::link( Title::makeTitle( NS_USER, $userText ), $userText ); + $time = $this->getLanguage()->userTimeAndDate( $result->getTimestamp(), $this->getUser() ); return "$plink . . $user . . $time"; } -- cgit v1.2.3-54-g00ecf