Add link on Special:Upload to edit MediaWiki:Licenses
authorrobin <robinp.1273@gmail.com>
Fri, 27 Jun 2014 20:33:44 +0000 (22:33 +0200)
committerrobin <robinp.1273@gmail.com>
Sat, 28 Jun 2014 20:22:06 +0000 (22:22 +0200)
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
languages/i18n/en.json
languages/i18n/qqq.json
skins/common/shared.css

index 01c0aaf..5802053 100644 (file)
@@ -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 = '<p class="mw-upload-editlicenses">' . $licensesLink . '</p>';
+                       $this->addFooterText( $editLicenses, 'description' );
+               }
+
                # Set some form properties
                $this->setSubmitText( $this->msg( 'uploadbtn' )->text() );
                $this->setSubmitName( 'wpUpload' );
index 33030c5..4178201 100644 (file)
        "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)",
index ef5d567..1f48b62 100644 (file)
        "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}}",
index a5612e2..adfca80 100644 (file)
@@ -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;
 }