From: jenkins-bot Date: Wed, 14 Jun 2017 13:39:23 +0000 (+0000) Subject: Merge "Linked HTML representation of a format to formatted output" X-Git-Tag: 1.31.0-rc.0~2982 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=3bf87f39002e58f0240ef8676efc5b3280287c53;hp=7f3d6713e7191c476adb3d3c30344a0327b853d3;p=lhc%2Fweb%2Fwiklou.git Merge "Linked HTML representation of a format to formatted output" --- diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index eb23bd63ac..36247dd981 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -219,7 +219,14 @@ abstract class ApiFormatBase extends ApiBase { if ( !$this->getIsWrappedHtml() ) { // When the format without suffix 'fm' is defined, there is a non-html version if ( $this->getMain()->getModuleManager()->isDefined( $lcformat, 'format' ) ) { - $msg = $context->msg( 'api-format-prettyprint-header' )->params( $format, $lcformat ); + if ( !$this->getRequest()->wasPosted() ) { + $nonHtmlUrl = strtok( $this->getRequest()->getFullRequestURL(), '?' ) + . '?' . $this->getRequest()->appendQueryValue( 'format', $lcformat ); + $msg = $context->msg( 'api-format-prettyprint-header-hyperlinked' ) + ->params( $format, $lcformat, $nonHtmlUrl ); + } else { + $msg = $context->msg( 'api-format-prettyprint-header' )->params( $format, $lcformat ); + } } else { $msg = $context->msg( 'api-format-prettyprint-header-only-html' )->params( $format ); } diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index ed3f25f3d9..5554105804 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -1513,6 +1513,7 @@ "api-format-title": "MediaWiki API result", "api-format-prettyprint-header": "This is the HTML representation of the $1 format. HTML is good for debugging, but is unsuitable for application use.\n\nSpecify the format parameter to change the output format. To see the non-HTML representation of the $1 format, set format=$2.\n\nSee the [[mw:Special:MyLanguage/API|complete documentation]], or the [[Special:ApiHelp/main|API help]] for more information.", "api-format-prettyprint-header-only-html": "This is an HTML representation intended for debugging, and is unsuitable for application use.\n\nSee the [[mw:Special:MyLanguage/API|complete documentation]], or the [[Special:ApiHelp/main|API help]] for more information.", + "api-format-prettyprint-header-hyperlinked": "This is the HTML representation of the $1 format. HTML is good for debugging, but is unsuitable for application use.\n\nSpecify the format parameter to change the output format. To see the non-HTML representation of the $1 format, set [$3 format=$2].\n\nSee the [[mw:API|complete documentation]], or the [[Special:ApiHelp/main|API help]] for more information.", "api-format-prettyprint-status": "This response would be returned with HTTP status $1 $2.", "api-login-fail-aborted": "Authentication requires user interaction, which is not supported by action=login. To be able to login with action=login, see [[Special:BotPasswords]]. To continue using main-account login, see [[Special:ApiHelp/clientlogin|action=clientlogin]].", diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json index e53ece6a6f..c5fb7994de 100644 --- a/includes/api/i18n/qqq.json +++ b/includes/api/i18n/qqq.json @@ -1407,7 +1407,8 @@ "apihelp-xml-param-includexmlnamespace": "{{doc-apihelp-param|xml|includexmlnamespace}}", "apihelp-xmlfm-description": "{{doc-apihelp-description|xmlfm|seealso=* {{msg-mw|apihelp-xml-description}}}}", "api-format-title": "{{technical}}\nPage title when API output is pretty-printed in HTML.", - "api-format-prettyprint-header": "{{technical}} Displayed as a header when API output is pretty-printed in HTML.\n\nParameters:\n* $1 - Format name\n* $2 - Non-pretty-printing module name", + "api-format-prettyprint-header": "{{technical}} Displayed as a header when API output is pretty-printed in HTML, but a post request is received.\n\nParameters:\n* $1 - Format name\n* $2 - Non-pretty-printing module name", + "api-format-prettyprint-header-hyperlinked": "{{technical}} Displayed as a header when API output is pretty-printed in HTML.\n\nParameters:\n* $1 - Format name\n* $2 - Non-pretty-printing module name\n* $3 - URL to Non-pretty-printing module", "api-format-prettyprint-header-only-html": "{{technical}} Displayed as a header when API output is pretty-printed in HTML, but there is no non-html module.\n\nParameters:\n* $1 - Format name", "api-format-prettyprint-status": "{{technical}} Displayed as a header when API pretty-printed output is used for a response that uses an unusual HTTP status code.\n\nParameters:\n* $1 - HTTP status code (integer)\n* $2 - Standard English text for the status code.", "api-login-fail-aborted": "{{technical}} Displayed as an error when API login fails due to AuthManager requiring user interaction.\n\nSee also:\n* {{msg-mw|api-login-fail-aborted-nobotpw}}",