);
}
- if ( isset( $prop['langlinks'] ) || isset( $prop['languageshtml'] ) ) {
+ if ( isset( $prop['langlinks'] ) ) {
$langlinks = $p_result->getLanguageLinks();
if ( $params['effectivelanglinks'] ) {
if ( isset( $prop['langlinks'] ) ) {
$result_array['langlinks'] = $this->formatLangLinks( $langlinks );
}
- if ( isset( $prop['languageshtml'] ) ) {
- $languagesHtml = $this->languagesHtml( $langlinks );
-
- $result_array['languageshtml'] = array();
- ApiResult::setContent( $result_array['languageshtml'], $languagesHtml );
- }
if ( isset( $prop['categories'] ) ) {
$result_array['categories'] = $this->formatCategoryLinks( $p_result->getCategories() );
}
return $context->getSkin()->getCategories();
}
- /**
- * @deprecated since 1.18 No modern skin generates language links this way,
- * please use language links data to generate your own HTML.
- * @param array $languages
- * @return string
- */
- private function languagesHtml( $languages ) {
- wfDeprecated( __METHOD__, '1.18' );
- $this->setWarning( '"action=parse&prop=languageshtml" is deprecated ' .
- 'and will be removed in MediaWiki 1.24. Use "prop=langlinks" ' .
- 'to generate your own HTML.' );
-
- global $wgContLang;
-
- if ( $this->getConfig()->get( 'HideInterlanguageLinks' ) || count( $languages ) == 0 ) {
- return '';
- }
-
- $s = htmlspecialchars( wfMessage( 'otherlanguages' )->text() .
- wfMessage( 'colon-separator' )->text() );
-
- $langs = array();
- foreach ( $languages as $l ) {
- $nt = Title::newFromText( $l );
- $text = Language::fetchLanguageName( $nt->getInterwiki() );
-
- $langs[] = Html::element( 'a',
- array( 'href' => $nt->getFullURL(), 'title' => $nt->getText(), 'class' => 'external' ),
- $text == '' ? $l : $text );
- }
-
- $s .= implode( wfMessage( 'pipe-separator' )->escaped(), $langs );
-
- if ( $wgContLang->isRTL() ) {
- $s = Html::rawElement( 'span', array( 'dir' => 'LTR' ), $s );
- }
-
- return $s;
- }
-
private function formatLinks( $links ) {
$result = array();
foreach ( $links as $ns => $nslinks ) {
ApiBase::PARAM_TYPE => array(
'text',
'langlinks',
- 'languageshtml',
'categories',
'categorieshtml',
'links',
' langlinks - Gives the language links in the parsed wikitext',
' categories - Gives the categories in the parsed wikitext',
' categorieshtml - Gives the HTML version of the categories',
- ' languageshtml - DEPRECATED. Will be removed in MediaWiki 1.24.',
- ' Gives the HTML version of the language links',
' links - Gives the internal links in the parsed wikitext',
' templates - Gives the templates in the parsed wikitext',
' images - Gives the images in the parsed wikitext',
),
'effectivelanglinks' => array(
'Includes language links supplied by extensions',
- '(for use with prop=langlinks|languageshtml)',
+ '(for use with prop=langlinks)',
),
'pst' => array(
'Do a pre-save transform on the input before parsing it',