r14136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14135‎ | r14136 | r14137 >
Date:18:17, 8 May 2006
Author:nikerabbit
Status:old
Tags:
Comment:
* Added many missing formatNum calls
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialCategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialMIMEsearch.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostimages.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinkedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostrevisions.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialMostrevisions.php
@@ -42,14 +42,14 @@
4343 }
4444
4545 function formatResult( $skin, $result ) {
46 - global $wgContLang;
 46+ global $wgLang, $wgContLang;
4747
4848 $nt = Title::makeTitle( $result->namespace, $result->title );
4949 $text = $wgContLang->convert( $nt->getPrefixedText() );
5050
5151 $plink = $skin->makeKnownLinkObj( $nt, $text );
5252
53 - $nl = wfMsg( 'nrevisions', $result->value );
 53+ $nl = wfMsg( 'nrevisions', $wgLang->formatNum( $result->value ) );
5454 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
5555
5656 return wfSpecialList($plink, $nlink);
Index: trunk/phase3/includes/SpecialMostimages.php
@@ -38,14 +38,14 @@
3939 }
4040
4141 function formatResult( $skin, $result ) {
42 - global $wgContLang;
 42+ global $wgLang, $wgContLang;
4343
4444 $nt = Title::makeTitle( $result->namespace, $result->title );
4545 $text = $wgContLang->convert( $nt->getPrefixedText() );
4646
4747 $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
4848
49 - $nl = wfMsg( 'nlinks', $result->value );
 49+ $nl = wfMsg( 'nlinks', $wgLang->formatNum ( $result->value ) );
5050 $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
5151
5252 return wfSpecialList($plink, $nlink);
Index: trunk/phase3/includes/SpecialRecentchanges.php
@@ -502,25 +502,22 @@
503503 $note = wfMsg( 'rcnote', $wgLang->formatNum( $options['limit'] ), $wgLang->formatNum( $options['days'] ), $wgLang->timeAndDate( wfTimestampNow(), true ) );
504504
505505 // limit links
506 - $cl = '';
507506 $options_limit = array(50, 100, 250, 500);
508 - $i = 0;
509 - while ( $i+1 < count($options_limit) ) {
510 - $cl .= makeOptionsLink( $options_limit[$i], array( 'limit' => $options_limit[$i] ), $nondefaults) . ' | ' ;
511 - $i++;
 507+ foreach( $options_limit as $value ) {
 508+ $cl[] = makeOptionsLink( $wgLang->formatNum( $value ),
 509+ array( 'limit' => $value ), $nondefaults) ;
512510 }
513 - $cl .= makeOptionsLink( $options_limit[$i], array( 'limit' => $options_limit[$i] ), $nondefaults) ;
 511+ $cl = implode( ' | ', $cl);
514512
515513 // day links, reset 'from' to none
516 - $dl = '';
517514 $options_days = array(1, 3, 7, 14, 30);
518 - $i = 0;
519 - while ( $i+1 < count($options_days) ) {
520 - $dl .= makeOptionsLink( $options_days[$i], array( 'days' => $options_days[$i], 'from' => '' ), $nondefaults) . ' | ' ;
521 - $i++;
 515+ foreach( $options_days as $value ) {
 516+ $dl[] = makeOptionsLink( $wgLang->formatNum( $value ),
 517+ array( 'days' => $value, 'from' => '' ), $nondefaults) ;
522518 }
523 - $dl .= makeOptionsLink( $options_days[$i], array( 'days' => $options_days[$i], 'from' => '' ), $nondefaults) ;
 519+ $dl = implode( ' | ', $dl);
524520
 521+
525522 // show/hide links
526523 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ));
527524 $minorLink = makeOptionsLink( $showhide[1-$options['hideminor']],
Index: trunk/phase3/includes/SpecialMostlinked.php
@@ -77,9 +77,11 @@
7878 * @return string
7979 */
8080 function formatResult( $skin, $result ) {
 81+ global $wgLang;
8182 $title = Title::makeTitleSafe( $result->namespace, $result->title );
8283 $link = $skin->makeLinkObj( $title );
83 - $wlh = $this->makeWlhLink( $title, wfMsgHtml( 'nlinks', $result->value ), $skin );
 84+ $wlh = $this->makeWlhLink( $title, wfMsgHtml( 'nlinks',
 85+ $wgLang->formatNum( $result->value ) ), $skin );
8486 return wfSpecialList( $link, $wlh );
8587 }
8688 }
Index: trunk/phase3/includes/SpecialMIMEsearch.php
@@ -72,7 +72,8 @@
7373 $download = $skin->makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) );
7474 $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
7575 $wgLang->formatNum( $result->img_size ) );
76 - $dimensions = wfMsg( 'widthheight', $result->img_width, $result->img_height );
 76+ $dimensions = wfMsg( 'widthheight', $wgLang->formatNum( $result->img_width ),
 77+ $wgLang->formatNum( $result->img_height ) );
7778 $user = $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text );
7879 $time = $wgLang->timeanddate( $result->img_timestamp );
7980
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php
@@ -57,14 +57,14 @@
5858 }
5959
6060 function formatResult( $skin, $result ) {
61 - global $wgContLang;
 61+ global $wgLang, $wgContLang;
6262
6363 $nt = Title::makeTitle( $result->namespace, $result->title );
6464 $text = $wgContLang->convert( $nt->getText() );
6565
6666 $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) );
6767
68 - $nlinks = wfMsg( 'members', $result->value );
 68+ $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->value ) );
6969 return wfSpecialList($plink, $nlinks);
7070 }
7171 }
Index: trunk/phase3/includes/SpecialCategories.php
@@ -50,9 +50,10 @@
5151 }
5252
5353 function formatResult( $skin, $result ) {
 54+ global $wgLang;
5455 $title = Title::makeTitle( NS_CATEGORY, $result->title );
5556 $plink = $skin->makeLinkObj( $title, $title->getText() );
56 - $nlinks = wfMsg( 'members', $result->count );
 57+ $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->count ) );
5758 return wfSpecialList($plink, $nlinks);
5859 }
5960 }
Index: trunk/phase3/includes/SpecialWantedcategories.php
@@ -59,7 +59,7 @@
6060 }
6161
6262 function formatResult( $skin, $result ) {
63 - global $wgContLang;
 63+ global $wgLang, $wgContLang;
6464
6565 $nt = Title::makeTitle( $result->namespace, $result->title );
6666 $text = $wgContLang->convert( $nt->getText() );
@@ -68,7 +68,7 @@
6969 $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
7070 $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
7171
72 - $nlinks = wfMsg( 'members', $result->value );
 72+ $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->value ) );
7373 return wfSpecialList($plink, $nlinks);
7474 }
7575 }
Index: trunk/phase3/includes/SpecialWantedpages.php
@@ -71,7 +71,7 @@
7272
7373
7474 function formatResult( $skin, $result ) {
75 - global $wgContLang;
 75+ global $wgLang;
7676
7777 $title = Title::makeTitleSafe( $result->namespace, $result->title );
7878
@@ -91,8 +91,9 @@
9292
9393 # Make a link to "what links here" if it's required
9494 $wlhLink = $this->nlinks
95 - ? $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks', $result->value ) )
96 - : "";
 95+ ? $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks',
 96+ $wgLang->formatNum( $result->value ) ) )
 97+ : null;
9798
9899 return wfSpecialList($pageLink, $wlhLink);
99100 }
@@ -106,7 +107,7 @@
107108 */
108109 function makeWlhLink( &$title, &$skin, $text ) {
109110 $wlhTitle = Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' );
110 - return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
 111+ return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
111112 }
112113
113114 }
Index: trunk/phase3/RELEASE-NOTES
@@ -226,6 +226,7 @@
227227 * (bug 5858) Update for Russian language (ru)
228228 * (bug 5860) Update for Indonesian language (id)
229229 * (bug 1120) Update for Czech language (Cs)
 230+* Added many missing formatNum calls
230231
231232 == Compatibility ==
232233

Status & tagging log