*
* @inheritdoc
*/
- function ForeignStructuredUpload( targetHost, apiconfig ) {
+ function ForeignStructuredUpload( target, apiconfig ) {
this.date = undefined;
this.descriptions = [];
this.categories = [];
- mw.ForeignUpload.call( this, targetHost, apiconfig );
+ mw.ForeignUpload.call( this, target, apiconfig );
}
OO.inheritClass( ForeignStructuredUpload, mw.ForeignUpload );
*/
ForeignStructuredUpload.prototype.getText = function () {
return (
+ '== {{int:filedesc}} ==\n' +
'{{' +
this.getTemplateName() +
'\n|description=' +
'\n|date=' +
this.getDate() +
'\n|source=' +
- this.getUser() +
+ this.getSource() +
'\n|author=' +
this.getUser() +
'\n}}\n\n' +
+ '== {{int:license-header}} ==\n' +
this.getLicense() +
'\n\n' +
this.getCategories()
};
/**
- * Gets the wikitext for the license of the upload. Abstract for now.
+ * Gets the wikitext for the license of the upload.
*
* @private
* @return {string}
*/
ForeignStructuredUpload.prototype.getLicense = function () {
- return '';
+ // Make sure this matches the messages for different targets in
+ // mw.ForeignStructuredUpload.BookletLayout.prototype.renderUploadForm
+ return this.target === 'shared' ? '{{self|cc-by-sa-4.0}}' : '';
+ };
+
+ /**
+ * Get the source. This should be some sort of localised text for "Own work".
+ *
+ * @private
+ * @return {string}
+ */
+ ForeignStructuredUpload.prototype.getSource = function () {
+ return '{{own}}';
};
/**