776 行
25 KiB
PHP
776 行
25 KiB
PHP
<?php
|
|
/**
|
|
* Upload Wizard Configuration
|
|
* Do not modify this file, instead use localsettings.php and set:
|
|
* $wgUploadWizardConfig[ 'name'] = 'value';
|
|
*/
|
|
|
|
use MediaWiki\Languages\LanguageNameUtils;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
global $wgFileExtensions, $wgServer, $wgScriptPath, $wgAPIModules, $wgLang,
|
|
$wgCheckFileExtensions;
|
|
|
|
$userLangCode = $wgLang->getCode();
|
|
// Commons only: ISO 646 code of Tagalog is 'tl', but language template is 'tgl'
|
|
$uwDefaultLanguageFixups = [ 'tl' => 'tgl' ];
|
|
|
|
$services = MediaWikiServices::getInstance();
|
|
$cache = $services->getMainWANObjectCache();
|
|
$uwLanguages = $cache->getWithSetCallback(
|
|
// We need to get a list of languages for the description dropdown.
|
|
// Increase the 'version' number in the options below if this logic or format changes.
|
|
$cache->makeKey( 'uploadwizard-language-templates', $userLangCode ),
|
|
$cache::TTL_DAY,
|
|
static function () use ( $userLangCode, $uwDefaultLanguageFixups, $services ) {
|
|
global $wgUploadWizardConfig;
|
|
|
|
$uwLanguages = [];
|
|
|
|
// First, get a list of languages we support.
|
|
$baseLangs = $services->getLanguageNameUtils()
|
|
->getLanguageNames( $userLangCode, LanguageNameUtils::ALL );
|
|
|
|
// We need to take into account languageTemplateFixups
|
|
$languageFixups = $wgUploadWizardConfig['languageTemplateFixups'] ?? $uwDefaultLanguageFixups;
|
|
if ( !is_array( $languageFixups ) ) {
|
|
$languageFixups = [];
|
|
}
|
|
|
|
// Use LinkBatch to make this a little bit more faster.
|
|
// It works because $title->exists (below) will use LinkCache.
|
|
$linkBatch = $services->getLinkBatchFactory()->newLinkBatch();
|
|
foreach ( $baseLangs as $code => $name ) {
|
|
$fixedCode = $languageFixups[$code] ?? $code;
|
|
if ( is_string( $fixedCode ) && $fixedCode !== '' ) {
|
|
$title = Title::makeTitle( NS_TEMPLATE, Title::capitalize( $fixedCode, NS_TEMPLATE ) );
|
|
$linkBatch->addObj( $title );
|
|
}
|
|
}
|
|
$linkBatch->execute();
|
|
|
|
// Then, check that there's a template for each one.
|
|
foreach ( $baseLangs as $code => $name ) {
|
|
$fixedCode = $languageFixups[$code] ?? $code;
|
|
if ( is_string( $fixedCode ) && $fixedCode !== '' ) {
|
|
$title = Title::makeTitle( NS_TEMPLATE, Title::capitalize( $fixedCode, NS_TEMPLATE ) );
|
|
if ( $title->exists() ) {
|
|
// If there is, then it's in the final picks!
|
|
$uwLanguages[$code] = $name;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Skip the duplicate deprecated language codes if the new one is okay to use.
|
|
foreach ( LanguageCode::getDeprecatedCodeMapping() as $oldKey => $newKey ) {
|
|
if ( isset( $uwLanguages[$newKey] ) ) {
|
|
unset( $uwLanguages[$oldKey] );
|
|
}
|
|
}
|
|
|
|
// Sort the list by the language name.
|
|
$collator = Collator::create( $userLangCode );
|
|
if ( !$collator || !$collator->asort( $uwLanguages ) ) {
|
|
natcasesort( $uwLanguages );
|
|
}
|
|
|
|
return $uwLanguages;
|
|
},
|
|
[
|
|
'version' => 3,
|
|
]
|
|
);
|
|
|
|
return [
|
|
// Upload wizard has an internal debug flag
|
|
'debug' => false,
|
|
|
|
// The default campaign to use.
|
|
'defaultCampaign' => '',
|
|
|
|
// Enable or disable the default upload license user preference
|
|
'enableLicensePreference' => true,
|
|
|
|
// Number of seconds to cache Campaign pages in squid, for anon users
|
|
'campaignSquidMaxAge' => 10 * 60,
|
|
|
|
// Enable or disable campaignstats that are expensive to compute
|
|
'campaignExpensiveStatsEnabled' => true,
|
|
|
|
// Number of seconds to cache Campaign stats
|
|
// Currently affects: Contributors count for each campaign
|
|
'campaignStatsMaxAge' => 60,
|
|
|
|
// Name of Campaign (as defined by Extension:Campaigns) to use for anon signup CTA
|
|
// Is used only if Campaign extension is detected
|
|
// $1 is replaced by the uploadcampaign name
|
|
'campaignCTACampaignTemplate' => 'uploadCampaign:$1',
|
|
|
|
// File extensions acceptable in this wiki
|
|
'fileExtensions' => $wgCheckFileExtensions ? $wgFileExtensions : null,
|
|
|
|
// Flickr details
|
|
// Flickr API is SSL-only as of June 27th, 2014:
|
|
// http://code.flickr.net/2014/04/30/flickr-api-going-ssl-only-on-june-27th-2014/
|
|
'flickrApiUrl' => '//api.flickr.com/services/rest/?',
|
|
|
|
// you should probably replace this with your own
|
|
'flickrApiKey' => 'aeefff139445d825d4460796616f9349',
|
|
|
|
// name of wiki page with blacklist of Flickr users
|
|
'flickrBlacklistPage' => '',
|
|
|
|
// Settings about things that get automatically (and silently) added to uploads
|
|
'autoAdd' => [
|
|
// Categories to automatically (and silently) add all uploaded images into.
|
|
'categories' => [],
|
|
|
|
// WikiText to automatically (and silently) add to all uploaded images.
|
|
'wikitext' => '',
|
|
],
|
|
|
|
// If the user didn't add categories, or removed the default categories, add this wikitext.
|
|
// Use this to indicate that some human should categorize this file.
|
|
// Does not consider autoAdd.categories, which are hidden.
|
|
'missingCategoriesWikiText' => '',
|
|
|
|
'display' => [
|
|
// wikitext to display above the UploadWizard UI.
|
|
'headerLabel' => '',
|
|
|
|
// wikitext to display on top of the "use" page.
|
|
// When not provided, the message mwe-upwiz-thanks-intro will be used.
|
|
'thanksLabel' => '',
|
|
|
|
// checkbox label to display with each entry on the upload page to choose one image that
|
|
// should be used as an image thumbnail for the referenced object
|
|
// When not provided, the message mwe-upwiz-objref-pick-image will be used.
|
|
'labelPickImage' => '',
|
|
|
|
// wikitext to display with each entry on the upload page to inform the users that there
|
|
// already is an image thumbnail for the referenced object
|
|
// When not provided, the message mwe-upwiz-objref-notice-existing-image will be used.
|
|
'noticeExistingImage' => '',
|
|
|
|
// wikitext to display on top of the "use" page if an image was marked with an object reference
|
|
// When not provided, the message mwe-upwiz-objref-notice-update-delay will be used.
|
|
'noticeUpdateDelay' => ''
|
|
],
|
|
|
|
// Settings for the tutorial to be shown.
|
|
// Empty array if we want to skip
|
|
'tutorial' => [
|
|
// Set to true to skip the tutorial
|
|
'skip' => true,
|
|
|
|
// Name of the tutorial. The $1 is replaced with the language desired.
|
|
'template' => 'License_Guide_($1).svg',
|
|
|
|
// The width we want to scale the tutorial to, for our interface.
|
|
'width' => 720,
|
|
|
|
// Imagemap coordinates of the "helpdesk" button at the bottom, which is supposed to be clickable.
|
|
// Empty string or false to not have an imagemap linked to the helpdesk.
|
|
'helpdeskCoords' => '',
|
|
],
|
|
|
|
// Tracking categories for various scenarios
|
|
'trackingCategory' => [
|
|
// Category added no matter what
|
|
// Default to none because we don't know what categories
|
|
// exist or not on local wikis.
|
|
// Do not uncomment this line, set
|
|
// $wgUploadWizardConfig['trackingCategory']['all']
|
|
// to your favourite category name.
|
|
|
|
// 'all' => '',
|
|
|
|
// Tracking category added for campaigns. $1 is replaced with campaign page name
|
|
'campaign' => 'Uploaded via Campaign:$1'
|
|
],
|
|
|
|
'fields' => [
|
|
// Field via which an ID can be provided.
|
|
[
|
|
// When non empty, this field will be shown, and $1 will be replaced by it's value.
|
|
'wikitext' => '',
|
|
|
|
// Label text to display with the field. Is parsed as wikitext.
|
|
'label' => '',
|
|
|
|
// The maximum length of the id field.
|
|
'maxLength' => 25,
|
|
|
|
// Initial value for the id field.
|
|
'initialValue' => '',
|
|
|
|
// Set to true if this field is required
|
|
'required' => false,
|
|
|
|
// Define the type of widget that will be rendered,
|
|
// pick between text and select
|
|
'type' => "text",
|
|
|
|
// If the type above is select, provide a dictionary of
|
|
// value -> label associations to display as options
|
|
'options' => [
|
|
/* 'value' => 'label' */
|
|
]
|
|
]
|
|
],
|
|
|
|
'defaults' => [
|
|
// Categories to list by default in the list of cats to add.
|
|
'categories' => [],
|
|
|
|
// Initial value for the caption field.
|
|
'caption' => '',
|
|
|
|
// Initial value for the description field.
|
|
'description' => '',
|
|
|
|
// These values are commented out by default, so they can be undefined
|
|
// Define them here if you want defaults.
|
|
// This is required, because the JsonSchema for these defines them to be type number
|
|
// But we can't have them to be NULL, because that's not a number.
|
|
// This is a technical limitation of JsonSchema, I think.
|
|
],
|
|
|
|
// 'uwLanguages' is a list of languages and codes, for use in the description step.
|
|
// See the definition of $uwLanguages above. If empty we'll just set a default.
|
|
'uwLanguages' => empty( $uwLanguages ) ? [ 'en' => 'English' ] : $uwLanguages,
|
|
|
|
// 'licenses' is a list of licenses you could possibly use elsewhere, for instance in
|
|
// licensesOwnWork or licensesThirdParty.
|
|
// It just describes what licenses go with what wikitext, and how to display them in
|
|
// a menu of license choices. There probably isn't any reason to delete any entry here.
|
|
// Under normal circumstances, the license name is the name of the wikitext template to insert.
|
|
// For those that aren't, there is a "templates" property.
|
|
'licenses' => [
|
|
'cc-by-sa-4.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-4.0',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/4.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-sa-3.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-3.0',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/3.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-sa-3.0-cn' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-3.0-cn',
|
|
'templates' => [ 'cc-by-sa-3.0-cn' ],
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/3.0/cn/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-4.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-4.0',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/4.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-3.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-3.0',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/3.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
|
|
'cc-by-3.0-cn' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-3.0-cn',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/3.0/cn/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-zero' => [
|
|
'msg' => 'mwe-upwiz-license-cc-zero',
|
|
'icons' => [ 'cc-zero' ],
|
|
'url' => '//creativecommons.org/publicdomain/zero/1.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'own-pd' => [
|
|
'msg' => 'mwe-upwiz-license-own-pd',
|
|
'icons' => [ 'cc-zero' ],
|
|
'templates' => [ 'cc-zero' ]
|
|
],
|
|
'cc-by-sa-2.5' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-2.5',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/2.5/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-sa-2.5-cn' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-2.5-cn',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/2.5/cn/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-2.5' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-2.5',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/2.5/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-2.5-cn' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-2.5-cn',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/2.5/cn/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-sa-2.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-sa-2.0',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'url' => '//creativecommons.org/licenses/by-sa/2.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'cc-by-2.0' => [
|
|
'msg' => 'mwe-upwiz-license-cc-by-2.0',
|
|
'icons' => [ 'cc-by' ],
|
|
'url' => '//creativecommons.org/licenses/by/2.0/',
|
|
'languageCodePrefix' => 'deed.'
|
|
],
|
|
'fal' => [
|
|
'msg' => 'mwe-upwiz-license-fal',
|
|
'templates' => [ 'FAL' ],
|
|
'url' => '//artlibre.org/licence/lal/en/'
|
|
],
|
|
'pd-us' => [
|
|
'msg' => 'mwe-upwiz-license-pd-us',
|
|
'templates' => [ 'PD-US-expired' ]
|
|
],
|
|
'pd-usgov' => [
|
|
'msg' => 'mwe-upwiz-license-pd-usgov',
|
|
'templates' => [ 'PD-USGov' ]
|
|
],
|
|
'pd-usgov-nasa' => [
|
|
'msg' => 'mwe-upwiz-license-pd-usgov-nasa',
|
|
'templates' => [ 'PD-USGov-NASA' ]
|
|
],
|
|
'pd-ineligible' => [
|
|
'msg' => 'mwe-upwiz-license-pd-ineligible'
|
|
],
|
|
'pd-textlogo' => [
|
|
'msg' => 'mwe-upwiz-license-pd-textlogo',
|
|
'templates' => [ 'trademarked', 'PD-textlogo' ]
|
|
],
|
|
'attribution' => [
|
|
'msg' => 'mwe-upwiz-license-attribution',
|
|
'templates' => ['attribution'],
|
|
],
|
|
'copyrighted-free-use' => [
|
|
'msg' => 'mwe-upwiz-license-copyrighted-free-use',
|
|
'templates' => ['Copyrighted free use'],
|
|
],
|
|
'gfdl' => [
|
|
'msg' => 'mwe-upwiz-license-gfdl',
|
|
'templates' => [ 'GFDL' ],
|
|
'url' => '//www.gnu.org/licenses/fdl-1.3.html'
|
|
],
|
|
'gfdl+cc-by-sa-3.0' => [
|
|
'msg' => 'mwe-upwiz-license-gfdl+cc-by-sa-3.0',
|
|
'icons' => [ 'cc-by', 'cc-sa' ],
|
|
'templates' => [ 'GFDL', 'cc-by-sa-3.0' ]
|
|
],
|
|
'gplv2' => [
|
|
'msg' => 'mwe-upwiz-license-gplv2',
|
|
'templates' => [ 'GPLv2' ],
|
|
'url' => '//www.gnu.org/licenses/old-licenses/gpl-2.0.html'
|
|
],
|
|
'gplv3' => [
|
|
'msg' => 'mwe-upwiz-license-gplv3',
|
|
'templates' => [ 'GPLv3' ],
|
|
'url' => '//www.gnu.org/licenses/gpl-3.0.html'
|
|
],
|
|
'gplv2-or-later-version' => [
|
|
'msg' => 'mwe-upwiz-license-gplv2-or-later-version',
|
|
'templates' => [ 'LGPL' ],
|
|
'url' => '//www.gnu.org/licenses/licenses.html#GPL'
|
|
],
|
|
'lgplv2' => [
|
|
'msg' => 'mwe-upwiz-license-lgplv2',
|
|
'templates' => [ 'LGPLv2' ],
|
|
'url' => '//www.gnu.org/licenses/old-licenses/lgpl-2.0.html'
|
|
],
|
|
'lgplv2.1' => [
|
|
'msg' => 'mwe-upwiz-license-lgplv2.1',
|
|
'templates' => [ 'LGPLv2.1' ],
|
|
'url' => '//www.gnu.org/licenses/old-licenses/lgpl-2.1.html'
|
|
],
|
|
'lgplv2.1-or-later-version' => [
|
|
'msg' => 'mwe-upwiz-license-lgplv2.1-or-later-version',
|
|
'templates' => [ 'LGPL' ],
|
|
'url' => '//www.gnu.org/licenses/licenses.html#LGPL'
|
|
],
|
|
'lgplv3' => [
|
|
'msg' => 'mwe-upwiz-license-lgplv3',
|
|
'templates' => [ 'LGPL' ],
|
|
'url' => '//www.gnu.org/licenses/lgpl-3.0.html'
|
|
],
|
|
'odbl' => [
|
|
'msg' => 'mwe-upwiz-license-odbl',
|
|
'templates' => [ 'ODbL' ],
|
|
'url' => '//opendatacommons.org/licenses/odbl/'
|
|
],
|
|
'none' => [
|
|
'msg' => 'mwe-upwiz-license-none',
|
|
'templates' => [ 'subst:uwl' ]
|
|
],
|
|
'custom' => [
|
|
'msg' => 'mwe-upwiz-license-custom',
|
|
'templates' => [ 'subst:Custom license marker added by UW' ],
|
|
'url' => wfMessage( 'mwe-upwiz-license-custom-url' )->parse()
|
|
],
|
|
'generic' => [
|
|
'msg' => 'mwe-upwiz-license-generic',
|
|
'templates' => [ 'Generic' ]
|
|
],
|
|
'pd-prc-exempt' => [
|
|
'msg' => 'mwe-upwiz-license-pd-prc-exempt',
|
|
'templates' => [ 'PD-PRC-exempt' ],
|
|
'url' => '//flk.npc.gov.cn/detail2.html?ZmY4MDgwODE3NTJiN2Q0MzAxNzVlNDc2NmJhYjE1NTc'
|
|
],
|
|
'prc-standardmap' => [
|
|
'msg' => 'mwe-upwiz-license-prc-standardmap',
|
|
'templates' => [ 'PRC-StandardMap' ],
|
|
'url' => 'https://www.gov.cn/zhengce/content/2015-12/14/content_10403.htm'
|
|
],
|
|
'pd-prc-1992' => [
|
|
'msg' => 'mwe-upwiz-license-pd-prc-1992',
|
|
'templates' => [ 'PD-PRC-1992' ],
|
|
'url' => 'https://www.ncac.gov.cn/chinacopyright/contents/12230/346374.shtml'
|
|
],
|
|
'pd-prc-foreign' => [
|
|
'msg' => 'mwe-upwiz-license-pd-prc-foreign',
|
|
'templates' => [ 'PD-PRC-foreign' ],
|
|
'url' => 'https://www.ncac.gov.cn/chinacopyright/contents/12230/346374.shtml'
|
|
],
|
|
'pd-prc' => [
|
|
'msg' => 'mwe-upwiz-license-pd-prc',
|
|
'templates' => [ 'PD-PRC' ],
|
|
'url' => 'https://flk.npc.gov.cn/detail2.html?ZmY4MDgwODE3NTJiN2Q0MzAxNzVlNDc2NmJhYjE1NTc'
|
|
],
|
|
'pd-macau-gov' => [
|
|
'msg' => 'mwe-upwiz-license-macau-gov',
|
|
'templates' => [ 'PD-MacauGov' ],
|
|
'url' => 'https://bo.io.gov.mo/bo/i/99/33/declei43_cn.asp'
|
|
],
|
|
'hongkong-factsheets' => [
|
|
'msg' => 'mwe-upwiz-license-hongkong-factsheets',
|
|
'templates' => [ 'Hong Kong Fact Sheets' ],
|
|
'url' => 'https://www.gov.hk/sc/about/abouthk/factsheets/index.htm'
|
|
],
|
|
'non-free-cover' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-cover',
|
|
'templates' => [ 'Non-free cover' ]
|
|
],
|
|
'non-free-mark' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-mark',
|
|
'templates' => [ 'Non-free mark' ]
|
|
],
|
|
'non-free-portrait' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-portrait',
|
|
'templates' => [ 'Non-free portrait' ]
|
|
],
|
|
'non-free-art' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-art',
|
|
'templates' => [ 'Non-free art' ]
|
|
],
|
|
'non-free-historical-image' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-historical-image',
|
|
'templates' => [ 'Non-free historical image' ]
|
|
],
|
|
'non-free-poster' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-poster',
|
|
'templates' => [ 'Non-free poster' ]
|
|
],
|
|
'non-free-screenshot' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-screenshot',
|
|
'templates' => [ 'Non-free screenshot' ]
|
|
],
|
|
'non-free-record' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-record',
|
|
'templates' => [ 'Non-free record' ]
|
|
],
|
|
'non-free-page' => [
|
|
'msg' => 'mwe-upwiz-license-non-free-page',
|
|
'templates' => [ 'Non-free page' ]
|
|
],
|
|
],
|
|
|
|
'licensing' => [
|
|
// Default license type.
|
|
// Possible values: ownwork, thirdparty, choice.
|
|
'defaultType' => 'choice',
|
|
|
|
// Should the own work option be shown, and if not, what option should be set?
|
|
// Possible values: own, notown, choice.
|
|
'ownWorkDefault' => 'choice',
|
|
|
|
// radio button selection of some licenses
|
|
'ownWork' => [
|
|
'type' => 'or',
|
|
'template' => 'self',
|
|
'defaults' => 'cc-by-sa-3.0-cn',
|
|
'licenses' => [
|
|
'cc-by-sa-4.0',
|
|
'cc-by-sa-3.0-cn',
|
|
'cc-by-4.0',
|
|
'cc-by-3.0-cn',
|
|
'cc-zero',
|
|
'fal',
|
|
'gplv2-or-later-version',
|
|
'lgplv2.1-or-later-version',
|
|
'attribution',
|
|
]
|
|
],
|
|
|
|
// checkbox selection of all licenses
|
|
'thirdParty' => [
|
|
'type' => 'or',
|
|
'defaults' => 'cc-by-sa-4.0',
|
|
'licenseGroups' => [
|
|
[
|
|
'head' => 'mwe-upwiz-license-cc-head',
|
|
'subhead' => 'mwe-upwiz-license-cc-subhead',
|
|
'licenses' => [
|
|
'cc-by-sa-4.0',
|
|
'cc-by-sa-3.0',
|
|
'cc-by-sa-3.0-cn',
|
|
'cc-by-sa-2.5',
|
|
'cc-by-sa-2.5-cn',
|
|
'cc-by-sa-2.0',
|
|
'cc-by-4.0',
|
|
'cc-by-3.0',
|
|
'cc-by-3.0-cn',
|
|
'cc-by-2.5',
|
|
'cc-by-2.5-cn',
|
|
'cc-by-2.0',
|
|
'cc-zero',
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-other-free-head',
|
|
'subhead' => 'mwe-upwiz-license-other-free-subhead',
|
|
'licenses' => [
|
|
'fal',
|
|
'gplv3',
|
|
'gplv2-or-later-version',
|
|
'gplv2',
|
|
'lgplv3',
|
|
'lgplv2.1',
|
|
'lgplv2.1-or-later-version',
|
|
'lgplv2',
|
|
'gfdl',
|
|
'gfdl+cc-by-sa-3.0',
|
|
'odbl',
|
|
'attribution',
|
|
'copyrighted-free-use',
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-public-domain-head',
|
|
'subhead' => 'mwe-upwiz-license-public-domain-subhead',
|
|
'licenses' => [
|
|
'pd-us',
|
|
'pd-prc-1992',
|
|
'pd-prc-foreign',
|
|
'pd-prc',
|
|
'pd-textlogo',
|
|
'pd-ineligible',
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-cngov-head',
|
|
'licenses' => [
|
|
'pd-prc-exempt',
|
|
'prc-standardmap',
|
|
'hongkong-factsheets',
|
|
'pd-macau-gov'
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-usgov-head',
|
|
'licenses' => [
|
|
'pd-usgov',
|
|
'pd-usgov-nasa'
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-non-free-head',
|
|
'subhead' => 'mwe-upwiz-license-non-free-subhead',
|
|
'licenses' => [
|
|
'non-free-mark',
|
|
'non-free-cover',
|
|
'non-free-art',
|
|
'non-free-poster',
|
|
'non-free-historical-image',
|
|
'non-free-portrait',
|
|
'non-free-screenshot',
|
|
'non-free-record',
|
|
'non-free-page',
|
|
]
|
|
],
|
|
[
|
|
'head' => 'mwe-upwiz-license-custom-head',
|
|
'special' => 'custom',
|
|
'licenses' => [ 'custom' ],
|
|
],
|
|
]
|
|
]
|
|
],
|
|
|
|
'patents' => [
|
|
'extensions' => [ 'stl' ],
|
|
'template' => '3dpatent',
|
|
'url' => [
|
|
'legalcode' => '//foundation.wikimedia.org/wiki/Wikimedia_3D_file_patent_license',
|
|
'warranty' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
|
|
'license' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
|
|
'weapons' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing#Weapons',
|
|
],
|
|
],
|
|
|
|
// Max author string length
|
|
'maxAuthorLength' => 10000,
|
|
|
|
// Min author string length
|
|
'minAuthorLength' => 1,
|
|
|
|
// Max source string length
|
|
'maxSourceLength' => 10000,
|
|
|
|
// Min source string length
|
|
'minSourceLength' => 5,
|
|
|
|
// Max file title string length
|
|
'maxTitleLength' => 240,
|
|
|
|
// Min file title string length
|
|
'minTitleLength' => 5,
|
|
|
|
// Max file caption length
|
|
'maxCaptionLength' => 250,
|
|
|
|
// Min file caption length
|
|
'minCaptionLength' => 5,
|
|
|
|
// Max file description length
|
|
'maxDescriptionLength' => 10000,
|
|
|
|
// Min file description length
|
|
'minDescriptionLength' => 5,
|
|
|
|
// Max length for other file information:
|
|
'maxOtherInformationLength' => 10000,
|
|
|
|
// Max number of simultaneous upload requests
|
|
'maxSimultaneousConnections' => 3,
|
|
|
|
// Max number of uploads for a given form
|
|
// TODO replace this configuration array with a class that uses dependency injection
|
|
'maxUploads' => RequestContext::getMain()->getUser()->isAllowed( 'mass-upload' ) ? 500 : 50,
|
|
|
|
// Max number of files that can be imported from Flickr at one time (T236341)
|
|
// Note that these numbers should always be equal to or less than the maxUploads above.
|
|
// TODO replace this configuration array with a class that uses dependency injection
|
|
'maxFlickrUploads' => RequestContext::getMain()->getUser()->isAllowed( 'mass-upload' ) ? 500 : 4,
|
|
|
|
// Max file size that is allowed by PHP (may be higher/lower than MediaWiki file size limit).
|
|
// When using chunked uploading, these limits can be ignored.
|
|
'maxPhpUploadSize' => UploadBase::getMaxPhpUploadSize(),
|
|
|
|
// Max file size that is allowed by MediaWiki. This limit can never be ignored.
|
|
'maxMwUploadSize' => UploadBase::getMaxUploadSize( 'file' ),
|
|
|
|
// Minimum length of custom wikitext for a license, if used.
|
|
// It is 6 because at minimum it needs four chars for opening and closing
|
|
// braces, then two chars for a license, e.g. {{xx}}
|
|
'minCustomLicenseLength' => 6,
|
|
|
|
// Maximum length of custom wikitext for a license
|
|
'maxCustomLicenseLength' => 10000,
|
|
|
|
// License template custom licenses should transclude (if any)
|
|
// This is the prefixed db key (e.g. Template:License_template_tag), or
|
|
// false to disable this check
|
|
'customLicenseTemplate' => false,
|
|
|
|
// The UploadWizard allows users to provide file descriptions in multiple languages. For each description, the user
|
|
// can choose the language. The UploadWizard wraps each description in a "language template". A language template is
|
|
// by default assumed to be a template with a name corresponding to the ISO 646 code of the language. For instance,
|
|
// Template:en for English, or Template:fr for French. This mechanism is used for instance at Wikimedia Commons.
|
|
// If this is not the case for some or all or your wiki's language templates, this map can be used to define the
|
|
// template names to be used. Keys are ISO 646 language codes, values are template names. The default defines the
|
|
// exceptions used at Wikimedia Commons: the language template for Tagalog (ISO 646 code 'tl') is not named 'tl'
|
|
// but 'tgl' for historical reasons.
|
|
'languageTemplateFixups' => $uwDefaultLanguageFixups,
|
|
|
|
// XXX this is horribly confusing -- some file restrictions are client side, others are server side
|
|
// the filename prefix blacklist is at least server side -- all this should be replaced with PHP regex config
|
|
// or actually, in an ideal world, we'd have some way to reliably detect gibberish, rather than trying to
|
|
// figure out what is bad via individual regexes, we'd detect badness. Might not be too hard.
|
|
//
|
|
// we can export these to JS if we so want.
|
|
// filenamePrefixBlacklist: wgFilenamePrefixBlacklist,
|
|
//
|
|
// filenameRegexBlacklist: [
|
|
// /^(test|image|img|bild|example?[\s_-]*)$/, // test stuff
|
|
// /^(\d{10}[\s_-][0-9a-f]{10}[\s_-][a-z])$/ // flickr
|
|
// ]
|
|
|
|
// Link to page where users can leave feedback or bug reports.
|
|
// Defaults to UploadWizard's bug tracker.
|
|
// If you want to use a wiki page, set this to a falsy value,
|
|
// and set feedbackPage to the name of the wiki page.
|
|
'feedbackLink' => '',
|
|
|
|
// [deprecated] Wiki page for leaving Upload Wizard feedback,
|
|
// for example 'Commons:Upload wizard feedback'
|
|
'feedbackPage' => '',
|
|
|
|
// Link to page containing a list of categories that the user can use for uploaded files.
|
|
// Shown on the Details stage, above the category selection field.
|
|
'allCategoriesLink' => 'https://www.qiuwenbaike.cn/wiki/Help:%E5%88%86%E7%B1%BB',
|
|
|
|
// Title of page for alternative uploading form, e.g.:
|
|
// 'altUploadForm' => 'Special:Upload',
|
|
//
|
|
// If different pages are required for different languages,
|
|
// supply an object mapping user language code to page. For a catch-all
|
|
// page for all languages not explicitly configured, use 'default'. For instance:
|
|
// array(
|
|
// 'default' => 'Commons:Upload',
|
|
// 'de' => 'Commons:Hochladen'
|
|
// );
|
|
'altUploadForm' => 'Special:Upload',
|
|
|
|
// Wiki page that lists alternative ways to upload
|
|
'alternativeUploadToolsPage' => 'Commons:Upload_tools',
|
|
|
|
// Wiki page for reporting issues with the blacklist
|
|
'blacklistIssuesPage' => '',
|
|
|
|
// When using chunked upload, what size, in bytes, should each chunk be?
|
|
'chunkSize' => 5 * 1024 * 1024,
|
|
|
|
// Should feature to copy metadata across a batch of uploads be enabled?
|
|
'copyMetadataFeature' => true,
|
|
|
|
// Should we pester the user with a confirmation step when submitting a file without assigning it
|
|
// to any categories?
|
|
'enableCategoryCheck' => true,
|
|
|
|
// enable structured data to go into a wikibase repository
|
|
'wikibase' => [
|
|
'enabled' => false,
|
|
'captions' => false,
|
|
'statements' => false,
|
|
'nonDefaultStatements' => false,
|
|
// url to wikibase repo API
|
|
'api' => $wgScriptPath . '/api.php',
|
|
],
|
|
];
|