From 8177e0a251820bb76a5b41e6b5e5b5e721163da7 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 7 Mar 2013 17:14:41 +0100 Subject: [PATCH] Merged in changes. --- h5p.classes.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 56252b2..42db4fd 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -670,13 +670,13 @@ class H5PStorage { public function savePackage($contentId, $contentMainId = NULL) { foreach ($this->h5pC->librariesJsonData as $key => &$library) { - $libraryId = $this->h5pF->getLibraryId($key, $library['majorVersion'], $library['minorVersion']); - if (!$libraryId) { + $library_id = $this->h5pF->getLibraryId($key, $library['majorVersion'], $library['minorVersion']); + if (!$library_id) { $new = TRUE; } elseif ($this->h5pF->isPatchedLibrary($library)) { $new = FALSE; - $library['libraryId'] = $libraryId; + $library['id'] = $library_id; } else { // We already have the same or a newer version of this library @@ -685,20 +685,20 @@ class H5PStorage { $this->h5pF->saveLibraryData($library, $new); $current_path = $this->h5pF->getUploadedH5pFolderPath() . DIRECTORY_SEPARATOR . $key; - $destination_path = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $library['libraryId']; + $destination_path = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $library['id']; $this->h5pC->delTree($destination_path); rename($current_path, $destination_path); } foreach ($this->h5pC->librariesJsonData as $key => &$library) { // All libraries have been saved, we now save all the dependencies if (isset($library['preloadedDependencies'])) { - $this->h5pF->saveLibraryDependencies($library['libraryId'], $library['preloadedDependencies'], 'preloaded'); + $this->h5pF->saveLibraryDependencies($library['id'], $library['preloadedDependencies'], 'preloaded'); } if (isset($library['dynamicDependencies'])) { - $this->h5pF->saveLibraryDependencies($library['libraryId'], $library['dynamicDependencies'], 'dynamic'); + $this->h5pF->saveLibraryDependencies($library['id'], $library['dynamicDependencies'], 'dynamic'); } if (isset($library['editorDependencies'])) { - $this->h5pF->saveLibraryDependencies($library['libraryId'], $library['editorDependencies'], 'editor'); + $this->h5pF->saveLibraryDependencies($library['id'], $library['editorDependencies'], 'editor'); } } $current_path = $this->h5pF->getUploadedH5pFolderPath() . DIRECTORY_SEPARATOR . 'content'; @@ -711,8 +711,8 @@ class H5PStorage { $this->h5pC->delTree($this->h5pF->getUploadedH5pFolderPath()); $contentJson = file_get_contents($destination_path . DIRECTORY_SEPARATOR . 'content.json'); - $mainLibraryId = $librariesInUse[$this->h5pC->mainJsonData['mainLibrary']]['library']['libraryId']; - $this->h5pF->saveContentData($contentId, $contentJson, $this->h5pC->mainJsonData, $mainLibraryId, $contentMainId); + $library_id = $librariesInUse[$this->h5pC->mainJsonData['mainLibrary']]['library']['id']; + $this->h5pF->saveContentData($contentId, $contentJson, $this->h5pC->mainJsonData, $library_id, $contentMainId); } public function deletePackage($contentId) {