Jump to content

Extension:MediaUploader/Configuration/Licensing

From mediawiki.org

Licensing? If you run a public wiki, in most jurisdictions you should worry about copyright, which applies to almost all published works. Media Uploader does not force you to obey these rules and it does not advise on how should you handle copyright. Rather, it gives you a tool to tackle this issue comprehensively.

After selecting the files to be uploaded, by default Media Uploader will show the user a selection of whether the work is their own or someone else's. Both options come with several licensing options indicating the terms (the license) under which the work can be used. Everything in this step can be customized.

Can I just disable all this?

[edit]

Yes, you can! Although we advocate for the proper recognition of people's authorship rights, there are cases where you just don't care or don't have to care (such as: internal wikis). In this case, simply disable the licensing step entirely:

$wgMediaUploaderConfig['licensing']['enabled'] = false;

licensing section

[edit]
G C

This section configures what licensing options are visible to the user and how can they select them. There are two "major" options available: the work is authored by the uploader (ownWork) or by someone else (thirdParty).

enabled

[edit]
G C

Whether to enable the licensing step. When false, the step is completely hidden and inaccessible.

Default
$wgMediaUploaderConfig['licensing']['enabled'] = true;

defaultType

[edit]
G C

Default licensing type. Possible values: ownWork, thirdParty, choice (no preference).

Default
$wgMediaUploaderConfig['licensing']['defaultType'] = 'choice';

showType

[edit]
G C

Which licensing types should be available to the user. Array, possible values: ownWork, thirdParty.

Default
$wgMediaUploaderConfig['licensing']['showType'] = [ 'ownWork', 'thirdParty' ];

ownWork and thirdParty

[edit]
G C

Both licensing sections are configured in the exact same way. They can be either a simple list of licenses (licenses), or a list of grouped licenses (licenseGroups). The latter is especially useful when you have many licenses available and they can be separated into, e.g., free, non-free, etc.

The examples below may be enlightening.

The sections have the following fields:

  • type (required) – whether to use radio button-style selection (radio) or checkboxes (checkbox). The latter allows the user to select multiple licenses.
  • defaults – either a license key or an array of license keys that will be selected in this group by default.
    • An array of license keys is valid only for the checkbox type license selection.
  • licenseWikitext – wikitext that wraps the wikitext of one license. $1 will be substituted for license's wikitext.
    • For example, if you want to wrap all licenses in the ownWork section in the {{own}} template, you would set this field to {{own|$1}}.
    • The default value is $1.

The following options can be used either on the entire licensing section (ownWork or thirdParty) when using a simple list of licenses or on a license group:

  • licenses – license keys to be available to the user. The keys must correspond to valid licenses from the licenses section.
    • Note: although the licensing section may be changed in campaigns, the licenses one cannot. Thus, if your campaign uses a custom license, you must define it in the global config.
  • licenseSeparator – if the user selected multiple licenses, this string will be used for joining them.
    • This could be used for, for example, the pipe symbol in multi-argument templates.
    • The default value is a single space character.
  • wrapper – wikitext that wraps the entire list of licenses (after wrapping each in licenseWrapper and joining them with licenseSeparator). $1 will be substituted for the list of licenses. $2 is the number of licenses that are being wrapped.
    • The default value is $1.

The following options can only be used in a license group:

  • head (required) – message for the heading of the license group
  • subhead – message for the subheading of the license group (gray text under the heading)
  • special – when set to custom, changes the group's behavior to include a text field for free-form license input. This can only be used on groups with one license (see example below).
Default (ownWork) – simple list of licenses
$wgMediaUploaderConfig['licensing']['ownWork'] = [
  'type' => 'radio',
  'wrapper' => '{{subst:int:mediauploader-content-license-ownwork|$2}} $1',
  'defaults' => 'cc-by-sa-4.0',
  'licenses' => [
    'cc-by-sa-4.0',
    'cc-by-sa-3.0',
    'cc-by-4.0',
    'cc-by-3.0',
    'cc-zero'
  ]
];
Default (thirdParty) – license groups
$wgMediaUploaderConfig['licensing']['thirdParty'] = [
  'type' => 'radio',
  'defaults' => 'cc-by-sa-4.0',
  'licenseGroups' => [
    [
      'head' => 'mediauploader-license-cc-head',
      'licenses' => [
        'cc-by-sa-4.0',
        'cc-by-sa-3.0',
        'cc-by-sa-2.5',
        'cc-by-4.0',
        'cc-by-3.0',
        'cc-by-2.5',
        'cc-zero'
      ]
    ],
    [
      'head' => 'mediauploader-license-custom-head',
      'special' => 'custom',
      'licenses' => [ 'custom' ],
    ],
    [
      'head' => 'mediauploader-license-none-head',
      'licenses' => [ 'none' ]
    ],
  ]
];

licenses

[edit]
G

A list of licenses you could possibly use elsewhere, for instance in licensing['ownWork'] or licensing['thirdParty']. It just describes what licenses go with what wikitext, and how to display them in a menu of license choices.

Each license in this list has a number of fields:

  • msg (required) – system message with the name of the license to display in the license list. The message has two arguments:
    1. number of works being licensed
    2. URL of the license (if set, see below)
  • icons – an array of icon names to be added after the name of the license in the license list. See the license icons section below.
  • wikitext (required) – the wikitext this license will be transformed into when the upload is saved. By default, this is just the name of the license, but if you want, you can put templates here. See also the licensing section, it allows you to wrap this wikitext into more complex stuff.
  • url – license URL to be supplied in the license name message's second argument.
  • languageCodePrefix – when present, it is appended to the license's URL. After it, the user's ISO language code is appended. This can be used to direct users to a localized version of the license's legal code.
  • explainMsg – system message that appears when the user selects this license in the own work licensing section. The message takes one parameter:
    1. number of works being licensed
Default
$wgMediaUploaderConfig['licenses'] = [
  // The full list of available licenses is too long to be included here.
  // See the "Licenses available by default" section below.
  // Example license:
  'cc-zero' => [
    'msg' => 'mediauploader-license-cc-zero',
    'icons' => [ 'cc-zero' ],
    'url' => '//creativecommons.org/publicdomain/zero/1.0/',
    'languageCodePrefix' => 'deed.',
    'explainMsg' => 'mediauploader-source-ownwork-cc-zero-explain',
    'wikitext' => '{{subst:int:mediauploader-license-cc-zero||//creativecommons.org/publicdomain/zero/1.0/}}'
  ],
];

Licenses available by default

[edit]

For the sake of convenience, Media Uploader comes with several built-in licenses that you can use or modify. Please note that Media Uploader is a piece of PHP code, and not a lawyer, so it is not wise to rely on these legal texts alone. Review the licenses carefully and make sure they make sense in your jurisdiction and for your wiki.

  • Creative Commons – Media Uploader has all popular variations of CC licenses in versions: 2.0, 2.5, 3.0, 4.0. In the license keys below, {version} signifies any of these versions. So, for example, cc-by-2.5 is a license that you can use out of the box with Media Uploader.
    • cc-zero – CC0, releasing the work in the public domain
    • cc-by-{version} – Attribution
    • cc-by-nc-{version} – Attribution NonCommercial
    • cc-by-nd-{version} – Attribution NoDerivatives
    • cc-by-nc-nd-{version} – Attribution NonCommercial NoDerivatives
    • cc-by-nc-sa-{version} – Attribution NonCommercial ShareAlike
    • cc-by-sa-{version} – Attribution ShareAlike
  • Other copyleft licenses
  • Public domain
    • pd-old – the copyright for this work has expired
    • pd-ineligible – the work is too simple to be copyrighted
  • Other
    • copyright – all rights reserved
    • generic – generic statement that the work is acceptable under wiki's terms of use
    • custom – custom, free-form input by the user
    • none – the user doesn't know what is the license

License icons

[edit]

License icons (such as those used in Creative Commons licenses) can be a helpful visual aid for users to quickly locate what they are looking for. MediaUploader comes with several icons by default (not all are used in the licenses available by default):

Name Icon
cc
cc-by
cc-nc
cc-nd
cc-pd
cc-sa
cc-zero
copydown[1]
copyleft
copyright
no-weapons[2]

You can also add custom icons by defining a custom CSS class on your wiki:

.mediauploader-NAME-icon {
	background-image: url( path/to/icon.svg );
}

Simply replace NAME with the name of your icon and add a meaningful path to the appropriate file.

additionalMessages

[edit]
G

An array of additional system messages to be loaded with MediaUploader. This is only useful if your campaigns define custom license groups. MediaUploader has no way of knowing about them when loading the global config, so you will have to list them manually in this setting.

Default
$wgMediaUploaderConfig['additionalMessages'] = [];
Example
$wgMediaUploaderConfig['additionalMessages'] = [
  'message-key-1',
  'another-message-key'
];

References

[edit]
  1. Copydown is a pseudo-legal solution used on wikis that work with partially free derivative content
  2. This is not a license icon, but it was included with the original UploadWizard and weapons are bad, so here it is