commit
30cb2aec45
|
@ -451,6 +451,19 @@ class H5PDefaultStorage implements \H5PFileStorage {
|
||||||
return self::dirReady($this->path);
|
return self::dirReady($this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the file presave.js exists in the root of the library
|
||||||
|
*
|
||||||
|
* @param string $libraryFolder
|
||||||
|
* @param string $developmentPath
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPresave($libraryFolder, $developmentPath = null) {
|
||||||
|
$path = is_null($developmentPath) ? 'libraries' . DIRECTORY_SEPARATOR . $libraryFolder : $developmentPath;
|
||||||
|
$filePath = realpath($this->path . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . 'presave.js');
|
||||||
|
return file_exists($filePath);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursive function for copying directories.
|
* Recursive function for copying directories.
|
||||||
*
|
*
|
||||||
|
|
|
@ -190,4 +190,13 @@ interface H5PFileStorage {
|
||||||
* @return bool True if server has the proper write access
|
* @return bool True if server has the proper write access
|
||||||
*/
|
*/
|
||||||
public function hasWriteAccess();
|
public function hasWriteAccess();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the library has a presave.js in the root folder
|
||||||
|
*
|
||||||
|
* @param string $libraryName
|
||||||
|
* @param string $developmentPath
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPresave($libraryName, $developmentPath = null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue