Save h5p libraries in folders with understandable names

namespaces
Svein-Tore Griff With 2013-04-13 14:55:33 +02:00
parent 18b2475918
commit 995e56cf60
1 changed files with 3 additions and 3 deletions

View File

@ -785,7 +785,7 @@ class H5PStorage {
$this->h5pF->saveLibraryData($library, $new); $this->h5pF->saveLibraryData($library, $new);
$current_path = $this->h5pF->getUploadedH5pFolderPath() . DIRECTORY_SEPARATOR . $key; $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); $this->h5pC->delTree($destination_path);
rename($current_path, $destination_path); rename($current_path, $destination_path);
} }
@ -1005,8 +1005,8 @@ class H5PCore {
* @return string * @return string
* On the form {machineName} {majorVersion}.{minorVersion} * On the form {machineName} {majorVersion}.{minorVersion}
*/ */
public function libraryToString($library) { public function libraryToString($library, $folderName = FALSE) {
return $library['machineName'] . ' ' . $library['majorVersion'] . '.' . $library['minorVersion']; return $library['machineName'] . ($folderName ? '_' : ' ') . $library['majorVersion'] . '.' . $library['minorVersion'];
} }
} }
?> ?>