diff --git a/h5p-metadata.class.php b/h5p-metadata.class.php index 830e9dc..572cfd0 100644 --- a/h5p-metadata.class.php +++ b/h5p-metadata.class.php @@ -65,7 +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') . + ',"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 6e45feb..8e5f21f 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1006,28 +1006,29 @@ class H5PValidator { if (!empty($missingLibraries)) { // We still have missing libraries, check if our main library has an upgrade (BUT only if we has content) $mainDependency = NULL; - if (!$skipContent && !empty($mainH5PData)) { - foreach ($mainH5PData['preloadedDependencies'] as $dep) { - if ($dep['machineName'] === $mainH5PData['mainLibrary']) { + if (!$skipContent && !empty($mainH5pData)) { + foreach ($mainH5pData['preloadedDependencies'] as $dep) { + if ($dep['machineName'] === $mainH5pData['mainLibrary']) { $mainDependency = $dep; } } } if ($skipContent || !$mainDependency || !$this->h5pF->libraryHasUpgrade(array( - 'machineName' => $mainDependency['mainLibrary'], + 'machineName' => $mainDependency['machineName'], 'majorVersion' => $mainDependency['majorVersion'], 'minorVersion' => $mainDependency['minorVersion'] ))) { foreach ($missingLibraries as $libString => $library) { $this->h5pF->setErrorMessage($this->h5pF->t('Missing required library @library', array('@library' => $libString)), 'missing-required-library'); + $valid = FALSE; } if (!$this->h5pC->mayUpdateLibraries()) { $this->h5pF->setInfoMessage($this->h5pF->t("Note that the libraries may exist in the file you uploaded, but you're not allowed to upload new libraries. Contact the site administrator about this.")); + $valid = FALSE; } } } - $valid = empty($missingLibraries) && $valid; } if (!$valid) { H5PCore::deleteFileTree($tmpDir); @@ -1782,7 +1783,7 @@ Class H5PExport { } // Update content.json with content from database - file_put_contents("{$tmpPath}/content/content.json", $content['params']); + file_put_contents("{$tmpPath}/content/content.json", $content['filtered']); // Make embedType into an array $embedTypes = explode(', ', $content['embedType']); @@ -2204,6 +2205,7 @@ class H5PCore { if ($this->exportEnabled) { // Recreate export file $exporter = new H5PExport($this->h5pF, $this); + $content['filtered'] = $params; $exporter->createExportFile($content); } diff --git a/styles/h5p.css b/styles/h5p.css index 3b3e1fe..1f81839 100644 --- a/styles/h5p.css +++ b/styles/h5p.css @@ -306,10 +306,11 @@ div.h5p-fullscreen { .h5p-embed-dialog .h5p-inner, .h5p-reuse-dialog .h5p-inner, .h5p-content-user-data-reset-dialog .h5p-inner { - width: 316px; + min-width: 316px; + max-width: 400px; left: 50%; top: 50%; - margin: 0 0 0 -158px; + transform: translateX(-50%); } .h5p-embed-dialog .h5p-embed-code-container, .h5p-embed-size {