diff --git a/h5p.classes.php b/h5p.classes.php index ecff6b4..95ec6ff 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1240,7 +1240,7 @@ class H5PStorage { * TRUE if one or more libraries were updated * FALSE otherwise */ - public function savePackage($content = NULL, $contentMainId = NULL, $skipContent = FALSE) { + public function savePackage($content = NULL, $contentMainId = NULL, $skipContent = FALSE, $options = array()) { if ($this->h5pF->mayUpdateLibraries()) { // Save the libraries we processed during validation $this->saveLibraries(); @@ -1268,6 +1268,10 @@ class H5PStorage { } $content['params'] = file_get_contents($current_path . DIRECTORY_SEPARATOR . 'content.json'); + + if (isset($options['disable'])) { + $content['disable'] = $options['disable']; + } $contentId = $this->h5pC->saveContent($content, $contentMainId); $this->contentId = $contentId; @@ -1413,9 +1417,9 @@ class H5PStorage { * TRUE if one or more libraries were updated * FALSE otherwise */ - public function updatePackage($contentId, $contentMainId = NULL) { + public function updatePackage($contentId, $contentMainId = NULL, $options) { $this->deletePackage($contentId); - return $this->savePackage($contentId, $contentMainId); + return $this->savePackage($contentId, $contentMainId, FALSE, $options); } /** diff --git a/js/h5p.js b/js/h5p.js index 146a686..f8efddb 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -1525,6 +1525,9 @@ H5P.createUUID = function() { }; H5P.createTitle = function(rawTitle, maxLength) { + if (!rawTitle) { + return ''; + } if (maxLength === undefined) { maxLength = 60; }