diff --git a/h5p-metadata.class.php b/h5p-metadata.class.php index 73223b1..830e9dc 100644 --- a/h5p-metadata.class.php +++ b/h5p-metadata.class.php @@ -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') . '}'; } diff --git a/h5p.classes.php b/h5p.classes.php index d3e7ee1..1868daf 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -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;