From 32b0840ca6d4517a3ae3c7055320da30f9f95130 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Thu, 21 Feb 2019 13:42:00 +0100 Subject: [PATCH] HFP-2654 Add default language as part of metadata --- h5p-metadata.class.php | 5 +++++ h5p.classes.php | 5 +++++ 2 files changed, 10 insertions(+) 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..4fac2c4 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -4568,6 +4568,11 @@ class H5PContentValidator { 'type' => 'text', 'widget' => 'none' ), + (object) array( + 'name' => 'defaultLanguage', + 'type' => 'text', + 'widget' => 'none' + ) ); return $semantics;