// TODO: Does this still need $wgTitle?
global $wgParser, $wgTitle;
- // Currently unnecessary, code to act as a safeguard against any change
- // in current behavior of uselang
- $oldLang = null;
- if ( isset( $params['uselang'] )
- && $params['uselang'] != $this->getContext()->getLanguage()->getCode()
- ) {
- $oldLang = $this->getContext()->getLanguage(); // Backup language
- $this->getContext()->setLanguage( Language::factory( $params['uselang'] ) );
- }
-
$redirValues = null;
// Return result
$result_array['modulemessages'] = array_values( array_unique( $p_result->getModuleMessages() ) );
}
+ if ( isset( $prop['indicators'] ) ) {
+ foreach ( $p_result->getIndicators() as $name => $content ) {
+ $indicator = array( 'name' => $name );
+ ApiResult::setContent( $indicator, $content );
+ $result_array['indicators'][] = $indicator;
+ }
+ }
+
if ( isset( $prop['iwlinks'] ) ) {
$result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() );
}
'sections' => 's',
'headitems' => 'hi',
'modules' => 'm',
+ 'indicators' => 'ind',
'modulescripts' => 'm',
'modulestyles' => 'm',
'modulemessages' => 'm',
);
$this->setIndexedTagNames( $result_array, $result_mapping );
$result->addValue( null, $this->getModuleName(), $result_array );
-
- if ( !is_null( $oldLang ) ) {
- $this->getContext()->setLanguage( $oldLang ); // Reset language to $oldLang
- }
}
/**
$entry['lang'] = $bits[0];
if ( $title ) {
$entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
- // localised language name in user language (maybe set by uselang=)
+ // localised language name in 'uselang' language
$entry['langname'] = Language::fetchLanguageName(
$title->getInterwiki(),
$this->getLanguage()->getCode()
'headitems',
'headhtml',
'modules',
+ 'indicators',
'iwlinks',
'wikitext',
'properties',
'pst' => false,
'onlypst' => false,
'effectivelanglinks' => false,
- 'uselang' => null,
'section' => null,
'disablepp' => false,
'disableeditsection' => false,
' 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',
+ ' indicators - Gives the HTML of page status indicators 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',
'Returns the same wikitext, after a PST has been applied.',
"Only valid when used with {$p}text",
),
- 'uselang' => 'Which language to parse the request in',
'section' => 'Only retrieve the content of this section number',
'disablepp' => 'Disable the PP Report from the parser output',
'disableeditsection' => 'Disable edit section links from the parser output',