Merge branch 'language-switcher'
commit
d3b5b07669
|
@ -40,6 +40,10 @@ abstract class H5PMetadata {
|
|||
),
|
||||
'yearTo' => array(
|
||||
'type' => 'int'
|
||||
),
|
||||
'defaultLanguage' => array(
|
||||
'type' => 'text',
|
||||
'maxLength' => 32,
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -61,6 +65,7 @@ abstract class H5PMetadata {
|
|||
',"yearFrom":' . (isset($content->year_from) ? $content->year_from : 'null') .
|
||||
',"yearTo":' . (isset($content->year_to) ? $content->year_to : 'null') .
|
||||
',"changes":' . (isset($content->changes) ? $content->changes : 'null') .
|
||||
',"defaultLanguage":' . (isset($content->default_language) ? $content->default_language : 'null') .
|
||||
',"authorComments":' . (isset($content->author_comments) ? json_encode($content->author_comments) : 'null') . '}';
|
||||
}
|
||||
|
||||
|
|
|
@ -1671,7 +1671,7 @@ Class H5PExport {
|
|||
'embedTypes' => $embedTypes
|
||||
);
|
||||
|
||||
foreach(array('authors', 'source', 'license', 'licenseVersion', 'licenseExtras' ,'yearFrom', 'yearTo', 'changes', 'authorComments') as $field) {
|
||||
foreach(array('authors', 'source', 'license', 'licenseVersion', 'licenseExtras' ,'yearFrom', 'yearTo', 'changes', 'authorComments', 'defaultLanguage') as $field) {
|
||||
if (isset($content['metadata'][$field]) && $content['metadata'][$field] !== '') {
|
||||
if (($field !== 'authors' && $field !== 'changes') || (count($content['metadata'][$field]) > 0)) {
|
||||
$h5pJson[$field] = json_decode(json_encode($content['metadata'][$field], TRUE));
|
||||
|
@ -4568,6 +4568,11 @@ class H5PContentValidator {
|
|||
'type' => 'text',
|
||||
'widget' => 'none'
|
||||
),
|
||||
(object) array(
|
||||
'name' => 'defaultLanguage',
|
||||
'type' => 'text',
|
||||
'widget' => 'none'
|
||||
)
|
||||
);
|
||||
|
||||
return $semantics;
|
||||
|
|
Loading…
Reference in New Issue