API: Create a module bundle for 'apipretty' and 'apihelp'
[lhc/web/wiklou.git] / includes / api / ApiHelp.php
index 1656e7c..988957b 100644 (file)
@@ -40,7 +40,8 @@ class ApiHelp extends ApiBase {
 
                // Get the help
                $context = new DerivativeContext( $this->getMain()->getContext() );
-               $context->setSkin( SkinFactory::getDefaultInstance()->makeSkin( 'apioutput' ) );
+               $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
+               $context->setSkin( $skinFactory->makeSkin( 'apioutput' ) );
                $context->setLanguage( $this->getMain()->getLanguage() );
                $context->setTitle( SpecialPage::getTitleFor( 'ApiHelp' ) );
                $out = new OutputPage( $context );
@@ -99,7 +100,7 @@ class ApiHelp extends ApiBase {
                $out = $context->getOutput();
                $out->addModuleStyles( [
                        'mediawiki.hlist',
-                       'mediawiki.apihelp',
+                       'mediawiki.apipretty',
                ] );
                if ( !empty( $options['toc'] ) ) {
                        $out->addModuleStyles( 'mediawiki.toc.styles' );
@@ -583,7 +584,8 @@ class ApiHelp extends ApiBase {
                                                                        break;
 
                                                                case 'namespace':
-                                                                       $namespaces = MWNamespace::getValidNamespaces();
+                                                                       $namespaces = MediaWikiServices::getInstance()->
+                                                                               getNamespaceInfo()->getValidNamespaces();
                                                                        if ( isset( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] ) &&
                                                                                is_array( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] )
                                                                        ) {