Merge "Make thumb_handler.php use MediaHandler::parseParamString"
[lhc/web/wiklou.git] / maintenance / language / StatOutputs.php
index d7c621e..e9d8c86 100644 (file)
@@ -1,5 +1,7 @@
 <?php
-if ( !defined( 'MEDIAWIKI' ) ) die();
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die();
+}
 /**
  * Statistic output classes.
  *
@@ -46,21 +48,21 @@ class statsOutput {
 /** Outputs WikiText */
 class wikiStatsOutput extends statsOutput {
        function heading() {
-               global $wgDummyLanguageCodes, $wgContLang;
+               global $wgDummyLanguageCodes;
                $version = SpecialVersion::getVersion( 'nodb' );
                echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
                echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
                echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
                echo 'English (en) is excluded because it is the default localization';
-               if( is_array( $wgDummyLanguageCodes ) ) {
+               if ( is_array( $wgDummyLanguageCodes ) ) {
                        $dummyCodes = array();
-                       foreach( $wgDummyLanguageCodes as $dummyCode ) {
-                               $dummyCodes[] = $wgContLang->getLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
+                       foreach ( $wgDummyLanguageCodes as $dummyCode => $correctCode ) {
+                               $dummyCodes[] = Language::fetchLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
                        }
                        echo ', as well as the following languages that are not intended for system message translations, usually because they redirect to other language codes: ' . implode( ', ', $dummyCodes );
                }
                echo ".\n\n"; # dot to end sentence
-               echo '{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;" width="100%"' . "\n";
+               echo '{| class="sortable wikitable" border="2" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' . "\n";
        }
        function footer() {
                echo "|}\n";
@@ -80,7 +82,9 @@ class wikiStatsOutput extends statsOutput {
                        # Weigh reverse with factor 20 so coloring takes effect more quickly as
                        # this option is used solely for reporting 'bad' percentages.
                        $v = $v * 20;
-                       if ( $v > 255 ) $v = 255;
+                       if ( $v > 255 ) {
+                               $v = 255;
+                       }
                        $v = 255 - $v;
                }
                if ( $v < 128 ) {
@@ -96,7 +100,7 @@ class wikiStatsOutput extends statsOutput {
                $color = $red . $green . $blue;
 
                $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
-               return 'bgcolor="#' . $color . '"|' . $percent;
+               return 'style="background-color:#' . $color . ';"|' . $percent;
        }
 }