jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/266402 )

Change subject: Linked HTML representation of a format to formatted output
......................................................................


Linked HTML representation of a format to formatted output

Added Hyperlink to non-HTML formatted output from the HTML
representation of the output

Bug: T123905
Change-Id: Id55c524a29f679b8e06d4e3d05bd50e8685fb830
---
M includes/api/ApiFormatBase.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
3 files changed, 11 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Anomie: Looks good to me, approved



diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index eb23bd6..36247dd 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -219,7 +219,14 @@
                        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 ed3f25f..5554105 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 <var>format</var> parameter to change the output format. To 
see the non-HTML representation of the $1 format, set 
<kbd>format=$2</kbd>.\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 <var>format</var> parameter to change the 
output format. To see the non-HTML representation of the $1 format, set [$3 
<kbd>format=$2</kbd>].\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 <kbd>action=login</kbd>. To be able to login with 
<kbd>action=login</kbd>, see [[Special:BotPasswords]]. To continue using 
main-account login, see 
<kbd>[[Special:ApiHelp/clientlogin|action=clientlogin]]</kbd>.",
diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json
index e53ece6..c5fb799 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}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/266402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id55c524a29f679b8e06d4e3d05bd50e8685fb830
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Keer25 <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to