Add storing of content type title in metadata
parent
cb2acb21c8
commit
7762f903c8
|
@ -3307,7 +3307,10 @@ class H5PCore {
|
|||
'licensePD' => $this->h5pF->t('Public Domain'),
|
||||
'licenseCC010' => $this->h5pF->t('CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'),
|
||||
'licensePDM' => $this->h5pF->t('Public Domain Mark'),
|
||||
'licenseC' => $this->h5pF->t('Copyright')
|
||||
'licenseC' => $this->h5pF->t('Copyright'),
|
||||
'contentType' => $this->h5pF->t('Content Type'),
|
||||
'licenseExtras' => $this->h5pF->t('License Extras'),
|
||||
'changes' => $this->h5pF->t('Changelog'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
17
js/h5p.js
17
js/h5p.js
|
@ -1108,6 +1108,7 @@ H5P.findCopyrights = function (info, parameters, contentId, extras) {
|
|||
H5P.buildMetadataCopyrights = function (metadata, contentTypeName) {
|
||||
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
||||
var dataset = {
|
||||
contentType: metadata.contentType,
|
||||
title: metadata.title,
|
||||
author: (metadata.authors && metadata.authors.length > 0) ? metadata.authors.map(function(author) {
|
||||
return (author.role) ? author.name + ' (' + author.role + ')' : author.name;
|
||||
|
@ -1122,19 +1123,7 @@ H5P.buildMetadataCopyrights = function (metadata, contentTypeName) {
|
|||
}).join(' / ') : undefined
|
||||
};
|
||||
|
||||
if (contentTypeName) {
|
||||
contentTypeName = contentTypeName
|
||||
.split(' ')[0]
|
||||
.replace(/^H5P\./, '')
|
||||
.replace(/([a-z])([A-Z])/g, '$1' + ' ' + '$2');
|
||||
}
|
||||
|
||||
return new H5P.MediaCopyright(
|
||||
dataset,
|
||||
{type: 'Content Type', licenseExtras: 'License Extras', changes: 'Changelog'},
|
||||
['type', 'title', 'license', 'author', 'year', 'source', 'licenseExtras', 'changes'],
|
||||
{type: contentTypeName}
|
||||
);
|
||||
return new H5P.MediaCopyright(dataset);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1424,7 +1413,7 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
|
|||
|
||||
if (order === undefined) {
|
||||
// Set default order
|
||||
order = ['title', 'author', 'year', 'source', 'license'];
|
||||
order = ['contentType', 'title', 'license', 'author', 'year', 'source', 'licenseExtras', 'changes'];
|
||||
}
|
||||
|
||||
for (var i = 0; i < order.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue