diff --git a/i18n/en.json b/i18n/en.json index 5096eaab..700667cc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,6 +19,7 @@ "interwiki_url": "URL", "interwiki-url-label": "URL:", "interwiki_url_intro": "Template for URLs. The placeholder $1 will be replaced by the pagename in [[prefix:pagename]].", + "interwiki-api-label": "API:", "interwiki_local": "Forward", "interwiki-local-label": "Forward", "interwiki_local_0_intro": "External HTTP requests to the local wiki using this interwiki prefix in the URL will result in a \"{{int:badtitle}}\" error page.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 16679716..536f1cf7 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -29,6 +29,7 @@ "interwiki_url": "{{optional}}\nUsed on [[Special:Interwiki]] as a column header of the table.\n\nSee also:\n*{{msg-mw|Interwiki-url-label}}\n{{Identical|URL}}", "interwiki-url-label": "{{optional}}\nUsed on [[Special:Interwiki]] as a field label in a form.\n\nSee also:\n* {{msg-mw|interwiki url}}\n{{Identical|URL}}", "interwiki_url_intro": "Used on [[Special:Interwiki]] so as to explain the data in the {{msg-mw|Interwiki url}} column of the table.\n\nParameters:\n* $1 is being rendered verbatim. It refers to the syntax of the values listed in the \"prefix\" column, and does not mark a substitutable variable of this message.", + "interwiki-api-label": "{{optional}}\nUsed on [[Special:Interwiki]] as a field label in a form.", "interwiki_local": "Used on [[Special:Interwiki]] as a column header.\n\n{{Identical|Forward}}", "interwiki-local-label": "Field label for the interwiki property \"local\", to set if an HTTP request to the local wiki with this interwiki prefix in the URL is redirected to the target URL given in the interwiki link definitions.\n{{Identical|Forward}}", "interwiki_local_0_intro": "Used on [[Special:Interwiki]] so as to describe the meaning of the value 0 in the {{msg-mw|Interwiki local}} column of the table.\n\nRefers to {{msg-mw|Badtitle}}.\n\nSee also:\n* {{msg-mw|Interwiki local 1 intro}}", diff --git a/includes/SpecialInterwiki.php b/includes/SpecialInterwiki.php index 01144d71..76c6ec4e 100644 --- a/includes/SpecialInterwiki.php +++ b/includes/SpecialInterwiki.php @@ -144,6 +144,15 @@ class SpecialInterwiki extends SpecialPage { 'size' => 60, ], + 'api' => [ + 'type' => 'url', + 'id' => 'mw-interwiki-api', + 'label-message' => 'interwiki-api-label', + 'maxlength' => 200, + 'name' => 'wpInterwikiAPI', + 'size' => 60, + ], + 'reason' => [ 'type' => 'text', 'id' => "mw-interwiki-{$action}reason", @@ -191,6 +200,7 @@ class SpecialInterwiki extends SpecialPage { $status->fatal( 'interwiki_editerror', $prefix ); } else { $formDescriptor['url']['default'] = $row->iw_url; + $formDescriptor['api']['default'] = $row->iw_api; $formDescriptor['trans']['default'] = $row->iw_trans; $formDescriptor['local']['default'] = $row->iw_local; } @@ -278,11 +288,13 @@ class SpecialInterwiki extends SpecialPage { $prefix = $contLang->lc( $prefix ); case 'edit': $theurl = $data['url']; + $api = $data['api'] ?? ''; $local = $data['local'] ? 1 : 0; $trans = $data['trans'] ? 1 : 0; $rows = [ 'iw_prefix' => $prefix, 'iw_url' => $theurl, + 'iw_api' => $api, 'iw_local' => $local, 'iw_trans' => $trans ];