From: Rohan Date: Tue, 1 Jul 2014 13:34:33 +0000 (+0530) Subject: Removes 'languageshtml' property in mediawiki API's 'parse' action X-Git-Tag: 1.31.0-rc.0~15142^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=f1b0316570b5f669ed807739f3a0fec8e606a679 Removes 'languageshtml' property in mediawiki API's 'parse' action Bug: 67149 Change-Id: Ib1dfa0d04380839bbe474cbb5c0a9b6af09b8371 --- diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 8974e68c5b..217dd3c34a 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -134,6 +134,7 @@ production. The old format is still used if prop isn't provided, but this is deprecated. * meta=userinfo can now return the count of unread pages on the watchlist. * list=watchlist can now filter by unread status. +* The deprecated action=parse&prop=languageshtml has been removed. === Languages updated in 1.24 === diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 9dc4d03a39..b906b5960a 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -270,7 +270,7 @@ class ApiParse extends ApiBase { ); } - if ( isset( $prop['langlinks'] ) || isset( $prop['languageshtml'] ) ) { + if ( isset( $prop['langlinks'] ) ) { $langlinks = $p_result->getLanguageLinks(); if ( $params['effectivelanglinks'] ) { @@ -286,12 +286,6 @@ class ApiParse extends ApiBase { 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() ); } @@ -563,46 +557,6 @@ class ApiParse extends ApiBase { 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 ) { @@ -723,7 +677,6 @@ class ApiParse extends ApiBase { ApiBase::PARAM_TYPE => array( 'text', 'langlinks', - 'languageshtml', 'categories', 'categorieshtml', 'links', @@ -782,8 +735,6 @@ class ApiParse extends ApiBase { ' 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', @@ -804,7 +755,7 @@ class ApiParse extends ApiBase { ), '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',