From 7845551c16e49b3c80e3a3993fe8ab1844de7247 Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 27 Jun 2014 22:33:44 +0200 Subject: [PATCH] Add link on Special:Upload to edit MediaWiki:Licenses Add a link below the licenses selector to edit those license options (if allowed to), similar to links on the block, delete and protect forms. Change-Id: Iff11d114cb1bfbc2c17de44369c482cee846ed9d --- includes/specials/SpecialUpload.php | 12 ++++++++++++ languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + skins/common/shared.css | 8 ++++++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 01c0aaf6f6..5802053761 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -788,6 +788,18 @@ class UploadForm extends HTMLForm { wfRunHooks( 'UploadFormInitDescriptor', array( &$descriptor ) ); parent::__construct( $descriptor, $context, 'upload' ); + # Add a link to edit MediaWik:Licenses + if ( $this->getUser()->isAllowed( 'editinterface' ) ) { + $licensesLink = Linker::link( + Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ), + $this->msg( 'licenses-edit' )->escaped(), + array(), + array( 'action' => 'edit' ) + ); + $editLicenses = '

' . $licensesLink . '

'; + $this->addFooterText( $editLicenses, 'description' ); + } + # Set some form properties $this->setSubmitText( $this->msg( 'uploadbtn' )->text() ); $this->setSubmitName( 'wpUpload' ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 33030c544b..41782018b1 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1414,6 +1414,7 @@ "license-header": "Licensing", "nolicense": "None selected", "licenses": "-", + "licenses-edit": "Edit license options", "license-nopreview": "(Preview not available)", "upload_source_url": "(a valid, publicly accessible URL)", "upload_source_file": "(a file on your computer)", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index ef5d567b8a..1f48b62431 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1576,6 +1576,7 @@ "license-header": "Used as section header in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Filedesc}}\n* {{msg-mw|Filestatus}}\n* {{msg-mw|Filesource}}\n{{Identical|Licensing}}", "nolicense": "{{Identical|None selected}}", "licenses": "{{notranslate}}", + "licenses-edit": "Label text for a link on Special:Upload to edit MediaWiki:Licenses", "license-nopreview": "Error message when a certain license does not exist", "upload_source_url": "Used in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Sourcefilename|label}}\n* {{msg-mw|Sourceurl|label}}\n* {{msg-mw|Upload source file}}\n* {{msg-mw|Upload-maxfilesize}}", "upload_source_file": "Used in [[Special:Upload]].\n\nSee also:\n* {{msg-mw|Sourcefilename|label}}\n* {{msg-mw|Sourceurl|label}}\n* {{msg-mw|Upload source url}}\n* {{msg-mw|Upload-maxfilesize}}", diff --git a/skins/common/shared.css b/skins/common/shared.css index a5612e22ba..adfca80a13 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -372,12 +372,16 @@ input#wpSummary { display: none; } -/* Convenience links to edit block, delete and protect reasons */ +/** + * Convenience links to edit block, delete and protect reasons + * and upload licenses + */ p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, p.mw-filedelete-editreasons, p.mw-delete-editreasons, -p.mw-revdel-editreasons { +p.mw-revdel-editreasons, +p.mw-upload-editlicenses { font-size: 90%; text-align: right; } -- 2.20.1