From 995e56cf60627c959195f68f6c4763ba854ec068 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Sat, 13 Apr 2013 14:55:33 +0200 Subject: [PATCH] Save h5p libraries in folders with understandable names --- h5p.classes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index d6a1c16..3d656c2 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -785,7 +785,7 @@ 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 . $this->h5pC->libraryToString($library, TRUE); $this->h5pC->delTree($destination_path); rename($current_path, $destination_path); } @@ -1005,8 +1005,8 @@ class H5PCore { * @return string * On the form {machineName} {majorVersion}.{minorVersion} */ - public function libraryToString($library) { - return $library['machineName'] . ' ' . $library['majorVersion'] . '.' . $library['minorVersion']; + public function libraryToString($library, $folderName = FALSE) { + return $library['machineName'] . ($folderName ? '_' : ' ') . $library['majorVersion'] . '.' . $library['minorVersion']; } } ?> \ No newline at end of file