From 18d3798ec128bf568457d5badfff77319b824365 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Fri, 8 Mar 2013 18:30:53 +0100 Subject: [PATCH] Revert "Merged in changes." This reverts commit 801234f263adc38b91f845019ef114fa65af370a. --- h5p.classes.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 42db4fd..56252b2 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) { - $library_id = $this->h5pF->getLibraryId($key, $library['majorVersion'], $library['minorVersion']); - if (!$library_id) { + $libraryId = $this->h5pF->getLibraryId($key, $library['majorVersion'], $library['minorVersion']); + if (!$libraryId) { $new = TRUE; } elseif ($this->h5pF->isPatchedLibrary($library)) { $new = FALSE; - $library['id'] = $library_id; + $library['libraryId'] = $libraryId; } 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['id']; + $destination_path = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . $library['libraryId']; $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['id'], $library['preloadedDependencies'], 'preloaded'); + $this->h5pF->saveLibraryDependencies($library['libraryId'], $library['preloadedDependencies'], 'preloaded'); } if (isset($library['dynamicDependencies'])) { - $this->h5pF->saveLibraryDependencies($library['id'], $library['dynamicDependencies'], 'dynamic'); + $this->h5pF->saveLibraryDependencies($library['libraryId'], $library['dynamicDependencies'], 'dynamic'); } if (isset($library['editorDependencies'])) { - $this->h5pF->saveLibraryDependencies($library['id'], $library['editorDependencies'], 'editor'); + $this->h5pF->saveLibraryDependencies($library['libraryId'], $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'); - $library_id = $librariesInUse[$this->h5pC->mainJsonData['mainLibrary']]['library']['id']; - $this->h5pF->saveContentData($contentId, $contentJson, $this->h5pC->mainJsonData, $library_id, $contentMainId); + $mainLibraryId = $librariesInUse[$this->h5pC->mainJsonData['mainLibrary']]['library']['libraryId']; + $this->h5pF->saveContentData($contentId, $contentJson, $this->h5pC->mainJsonData, $mainLibraryId, $contentMainId); } public function deletePackage($contentId) {