From: Krinkle Date: Mon, 29 Aug 2011 22:21:32 +0000 (+0000) Subject: Add support to only return keys in ApiAllMessages X-Git-Tag: 1.31.0-rc.0~28021 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=ef2e10fecbeb321102d4e1699b90d605d8f84820;p=lhc%2Fweb%2Fwiklou.git Add support to only return keys in ApiAllMessages * Applying patch from bug 30591 --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index ccdfcc4124..2a26284a7d 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -87,6 +87,7 @@ production. * (bug 18634) Create API to fetch MediaWiki's language fallback tree structure. * (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP address blocks for list=blocks. +* (bug 30591) Add support to only return keys in ApiAllMessages. === Languages updated in 1.19 === diff --git a/includes/api/ApiQueryAllmessages.php b/includes/api/ApiQueryAllmessages.php index 715b7a5d60..033865ceab 100644 --- a/includes/api/ApiQueryAllmessages.php +++ b/includes/api/ApiQueryAllmessages.php @@ -158,7 +158,9 @@ class ApiQueryAllmessages extends ApiQueryBase { } else { $msgString = $msg->plain(); } - ApiResult::setContent( $a, $msgString ); + if ( !$params['nocontent'] ) { + ApiResult::setContent( $a, $msgString ); + } if ( isset( $prop['default'] ) ) { $default = wfMessage( $message )->inLanguage( $langObj )->useDatabase( false ); if ( !$default->exists() ) { @@ -204,6 +206,7 @@ class ApiQueryAllmessages extends ApiQueryBase { ) ), 'enableparser' => false, + 'nocontent' => false, 'args' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_ALLOW_DUPLICATES => true, @@ -230,7 +233,8 @@ class ApiQueryAllmessages extends ApiQueryBase { 'messages' => 'Which messages to output. "*" (default) means all messages', 'prop' => 'Which properties to get', 'enableparser' => array( 'Set to enable parser, will preprocess the wikitext of message', - 'Will substitute magic words, handle templates etc.' ), + 'Will substitute magic words, handle templates etc.' ), + 'nocontent' => 'Set to not include the content of the messages in the output.', 'title' => 'Page name to use as context when parsing message (for enableparser option)', 'args' => 'Arguments to be substituted into message', 'prefix' => 'Return messages with this prefix',