Save h5p libraries in folders with understandable names
parent
18b2475918
commit
995e56cf60
|
@ -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'];
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue