Merge "Put wfDeprecated() on obsolete use of $wgSpecialPages"
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index a7cc436..a276117 100644 (file)
@@ -346,6 +346,13 @@ class ApiParse extends ApiBase {
                        }
                }
 
+               if ( isset( $prop['modules'] ) ) {
+                       $result_array['modules'] = array_values( array_unique( $p_result->getModules() ) );
+                       $result_array['modulescripts'] = array_values( array_unique( $p_result->getModuleScripts() ) );
+                       $result_array['modulestyles'] = array_values( array_unique( $p_result->getModuleStyles() ) );
+                       $result_array['modulemessages'] = array_values( array_unique( $p_result->getModuleMessages() ) );
+               }
+
                if ( isset( $prop['iwlinks'] ) ) {
                        $result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() );
                }
@@ -399,6 +406,10 @@ class ApiParse extends ApiBase {
                        'iwlinks' => 'iw',
                        'sections' => 's',
                        'headitems' => 'hi',
+                       'modules' => 'm',
+                       'modulescripts' => 'm',
+                       'modulestyles' => 'm',
+                       'modulemessages' => 'm',
                        'properties' => 'pp',
                        'limitreportdata' => 'lr',
                );
@@ -563,9 +574,9 @@ class ApiParse extends ApiBase {
                        'and will be removed in MediaWiki 1.24. Use "prop=langlinks" ' .
                        'to generate your own HTML.' );
 
-               global $wgContLang, $wgHideInterlanguageLinks;
+               global $wgContLang;
 
-               if ( $wgHideInterlanguageLinks || count( $languages ) == 0 ) {
+               if ( $this->getConfig()->get( 'HideInterlanguageLinks' ) || count( $languages ) == 0 ) {
                        return '';
                }
 
@@ -723,6 +734,7 @@ class ApiParse extends ApiBase {
                                        'displaytitle',
                                        'headitems',
                                        'headhtml',
+                                       'modules',
                                        'iwlinks',
                                        'wikitext',
                                        'properties',
@@ -779,6 +791,7 @@ class ApiParse extends ApiBase {
                                ' displaytitle   - Adds the title of the parsed wikitext',
                                ' headitems      - Gives items to put in the <head> of the page',
                                ' headhtml       - Gives parsed <head> of the page',
+                               ' modules        - Gives the ResourceLoader modules used on the page',
                                ' iwlinks        - Gives interwiki links in the parsed wikitext',
                                ' wikitext       - Gives the original wikitext that was parsed',
                                ' properties     - Gives various properties defined in the parsed wikitext',