Remove hitcounters and associated code
[lhc/web/wiklou.git] / includes / api / ApiQuerySiteinfo.php
index 7414453..feb869e 100644 (file)
@@ -344,7 +344,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                global $wgContLang;
                $data = array();
                $aliases = $wgContLang->getSpecialPageAliases();
-               foreach ( SpecialPageFactory::getList() as $specialpage => $stuff ) {
+               foreach ( SpecialPageFactory::getNames() as $specialpage ) {
                        if ( isset( $aliases[$specialpage] ) ) {
                                $arr = array( 'realname' => $specialpage, 'aliases' => $aliases[$specialpage] );
                                $this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
@@ -481,9 +481,6 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                $data = array();
                $data['pages'] = intval( SiteStats::pages() );
                $data['articles'] = intval( SiteStats::articles() );
-               if ( !$this->getConfig()->get( 'DisableCounters' ) ) {
-                       $data['views'] = intval( SiteStats::views() );
-               }
                $data['edits'] = intval( SiteStats::edits() );
                $data['images'] = intval( SiteStats::images() );
                $data['users'] = intval( SiteStats::users() );
@@ -696,6 +693,16 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                $allowed = Skin::getAllowedSkins();
                $default = Skin::normalizeKey( 'default' );
                foreach ( Skin::getSkinNames() as $name => $displayName ) {
+                       $msg = $this->msg( "skinname-{$name}" );
+                       $code = $this->getParameter( 'inlanguagecode' );
+                       if ( $code && Language::isValidCode( $code ) ) {
+                               $msg->inLanguage( $code );
+                       } else {
+                               $msg->inContentLanguage();
+                       }
+                       if ( $msg->exists() ) {
+                               $displayName = $msg->text();
+                       }
                        $skin = array( 'code' => $name );
                        ApiResult::setContent( $skin, $displayName );
                        if ( !isset( $allowed[$name] ) ) {
@@ -849,7 +856,8 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                ' restrictions          - Returns information on available restriction (protection) types',
                                ' languages             - Returns a list of languages MediaWiki supports ' .
                                        "(optionally localised by using {$p}inlanguagecode)",
-                               ' skins                 - Returns a list of all enabled skins',
+                               ' skins                 - Returns a list of all enabled skins ' .
+                                       "(optionally localised by using {$p}inlanguagecode, otherwise in content language)",
                                ' extensiontags         - Returns a list of parser extension tags',
                                ' functionhooks         - Returns a list of parser function hooks',
                                ' showhooks             - Returns a list of all subscribed hooks (contents of $wgHooks)',
@@ -861,7 +869,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        'showalldb' => 'List all database servers, not just the one lagging the most',
                        'numberingroup' => 'Lists the number of users in user groups',
                        'inlanguagecode' => 'Language code for localised language names ' .
-                               '(best effort, use CLDR extension)',
+                               '(best effort, use CLDR extension) and skin names',
                );
        }