diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/api/ApiQueryLangLinks.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/api/ApiQueryLangLinks.php')
-rw-r--r-- | includes/api/ApiQueryLangLinks.php | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index da05f273..5919ee97 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -124,7 +124,7 @@ class ApiQueryLangLinks extends ApiQueryBase { if ( isset( $prop['autonym'] ) ) { $entry['autonym'] = Language::fetchLanguageName( $row->ll_lang ); } - ApiResult::setContent( $entry, $row->ll_title ); + ApiResult::setContentValue( $entry, 'title', $row->ll_title ); $fit = $this->addPageSubItem( $row->ll_from, $entry ); if ( !$fit ) { $this->setContinueEnumParameter( 'continue', "{$row->ll_from}|{$row->ll_lang}" ); @@ -140,18 +140,6 @@ class ApiQueryLangLinks extends ApiQueryBase { public function getAllowedParams() { global $wgContLang; return array( - 'limit' => array( - ApiBase::PARAM_DFLT => 10, - ApiBase::PARAM_TYPE => 'limit', - ApiBase::PARAM_MIN => 1, - ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1, - ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2 - ), - 'continue' => null, - 'url' => array( - ApiBase::PARAM_DFLT => false, - ApiBase::PARAM_DEPRECATED => true, - ), 'prop' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array( @@ -170,36 +158,27 @@ class ApiQueryLangLinks extends ApiQueryBase { ) ), 'inlanguagecode' => $wgContLang->getCode(), - ); - } - - public function getParamDescription() { - return array( - 'limit' => 'How many langlinks to return', - 'continue' => 'When more results are available, use this to continue', - 'url' => "Whether to get the full URL (Cannot be used with {$this->getModulePrefix()}prop)", - 'prop' => array( - 'Which additional properties to get for each interlanguage link', - ' url - Adds the full URL', - ' langname - Adds the localised language name (best effort, use CLDR extension)', - " Use {$this->getModulePrefix()}inlanguagecode to control the language", - ' autonym - Adds the native language name', + 'limit' => array( + ApiBase::PARAM_DFLT => 10, + ApiBase::PARAM_TYPE => 'limit', + ApiBase::PARAM_MIN => 1, + ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1, + ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2 + ), + 'continue' => array( + ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', + ), + 'url' => array( + ApiBase::PARAM_DFLT => false, + ApiBase::PARAM_DEPRECATED => true, ), - 'lang' => 'Language code', - 'title' => "Link to search for. Must be used with {$this->getModulePrefix()}lang", - 'dir' => 'The direction in which to list', - 'inlanguagecode' => 'Language code for localised language names', ); } - public function getDescription() { - return 'Returns all interlanguage links from the given page(s).'; - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects=' - => 'Get interlanguage links from the [[Main Page]]', + 'action=query&prop=langlinks&titles=Main%20Page&redirects=' + => 'apihelp-query+langlinks-example-simple', ); } |