Merge "Removes 'languageshtml' property in mediawiki API's 'parse' action"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 1 Jul 2014 15:00:45 +0000 (15:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 1 Jul 2014 15:00:45 +0000 (15:00 +0000)
RELEASE-NOTES-1.24
includes/api/ApiParse.php

index 8e95222..73ba1c2 100644 (file)
@@ -147,6 +147,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 ===
 
index 9dc4d03..b906b59 100644 (file)
@@ -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',