r38953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38952‎ | r38953 | r38954 >
Date:21:31, 8 August 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Format numbers passed to messages
* Some whitespace changes
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -118,8 +118,8 @@
119119 $this->imageHistory();
120120 // TODO: Cleanup the following
121121
122 - $wgOut->addHTML( Xml::element( 'h2',
123 - array( 'id' => 'filelinks' ),
 122+ $wgOut->addHTML( Xml::element( 'h2',
 123+ array( 'id' => 'filelinks' ),
124124 wfMsg( 'imagelinks' ) ) . "\n" );
125125 $this->imageDupes();
126126 // TODO: We may want to find local images redirecting to a foreign
@@ -339,8 +339,10 @@
340340 # because of rounding.
341341 }
342342 $msgbig = wfMsgHtml( 'show-big-image' );
343 - $msgsmall = wfMsgExt( 'show-big-image-thumb',
344 - array( 'parseinline' ), $wgLang->formatNum( $width ), $wgLang->formatNum( $height ) );
 343+ $msgsmall = wfMsgExt( 'show-big-image-thumb', 'parseinline',
 344+ $wgLang->formatNum( $width ),
 345+ $wgLang->formatNum( $height )
 346+ );
345347 } else {
346348 # Image is small enough to show full size on image page
347349 $msgbig = htmlspecialchars( $this->displayImg->getName() );
@@ -614,7 +616,7 @@
615617 } else { $s=''; }
616618 $wgOut->addHTML( $s );
617619
618 - $this->img->resetHistory(); // free db resources
 620+ $this->img->resetHistory(); // free db resources
619621
620622 # Exist check because we don't want to show this on pages where an image
621623 # doesn't exist along with the noimage message, that would suck. -ævar
@@ -624,9 +626,8 @@
625627
626628 }
627629
628 - function imageLinks()
629 - {
630 - global $wgUser, $wgOut;
 630+ function imageLinks() {
 631+ global $wgUser, $wgOut, $wgLang;
631632
632633 $limit = 100;
633634
@@ -652,7 +653,10 @@
653654 $wgOut->addWikiMsg( 'linkstoimage', $count );
654655 } else {
655656 // More links than the limit. Add a link to [[Special:Whatlinkshere]]
656 - $wgOut->addWikiMsg( 'linkstoimage-more', $limit, $this->mTitle->getPrefixedDBkey() );
 657+ $wgOut->addWikiMsg( 'linkstoimage-more',
 658+ $wgLang->formatNum( $limit ),
 659+ $this->mTitle->getPrefixedDBkey()
 660+ );
657661 }
658662
659663 $wgOut->addHTML( "<ul class='mw-imagepage-linkstoimage'>\n" );
@@ -675,15 +679,16 @@
676680 $wgOut->addWikiMsg( 'morelinkstoimage', $this->mTitle->getPrefixedDBkey() );
677681 }
678682
679 - function imageRedirects()
680 - {
681 - global $wgUser, $wgOut;
 683+ function imageRedirects() {
 684+ global $wgUser, $wgOut, $wgLang;
682685
683686 $redirects = $this->getTitle()->getRedirectsHere( NS_IMAGE );
684687 if ( count( $redirects ) == 0 ) return;
685688
686689 $wgOut->addHTML( "<div id='mw-imagepage-section-redirectstofile'>\n" );
687 - $wgOut->addWikiMsg( 'redirectstofile', count( $redirects ) );
 690+ $wgOut->addWikiMsg( 'redirectstofile',
 691+ $wgLang->formatNum( count( $redirects ) )
 692+ );
688693 $wgOut->addHTML( "<ul class='mw-imagepage-redirectstofile'>\n" );
689694
690695 $sk = $wgUser->getSkin();
@@ -696,7 +701,7 @@
697702 }
698703
699704 function imageDupes() {
700 - global $wgOut, $wgUser;
 705+ global $wgOut, $wgUser, $wgLang;
701706
702707 $this->loadFile();
703708
@@ -704,16 +709,19 @@
705710 if ( count( $dupes ) == 0 ) return;
706711
707712 $wgOut->addHTML( "<div id='mw-imagepage-section-duplicates'>\n" );
708 - $wgOut->addWikiMsg( 'duplicatesoffile', count( $dupes ) );
 713+ $wgOut->addWikiMsg( 'duplicatesoffile',
 714+ $wgLang->formatNum( count( $dupes ) )
 715+ );
709716 $wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
710717
711718 $sk = $wgUser->getSkin();
712719 foreach ( $dupes as $file ) {
713720 if ( $file->isLocal() )
714721 $link = $sk->makeKnownLinkObj( $file->getTitle(), "" );
715 - else
716 - $link = $sk->makeExternalLink( $file->getDescriptionUrl(),
 722+ else {
 723+ $link = $sk->makeExternalLink( $file->getDescriptionUrl(),
717724 $file->getTitle()->getPrefixedText() );
 725+ }
718726 $wgOut->addHTML( "<li>{$link}</li>\n" );
719727 }
720728 $wgOut->addHTML( "</ul></div>\n" );
@@ -812,8 +820,8 @@
813821 . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '<td></td>' : '' )
814822 . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
815823 . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
816 - . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
817 - . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
 824+ . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
 825+ . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
818826 . "</tr>\n";
819827 }
820828

Status & tagging log