fix files_version hooks

This commit is contained in:
Robin Appelman 2013-01-28 20:04:10 +01:00
parent 7207211f3a
commit 929b8c3e69

View file

@ -39,15 +39,15 @@ class Hooks {
* cleanup the versions directory if the actual file gets deleted
*/
public static function remove_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$path = $params[\OC_Filesystem::signal_param_path];
if($path<>'') $versions->delete( $path );
}
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$path = $params[\OC\Files\Filesystem::signal_param_path];
if($path<>'') $versions->delete( $path );
}
}
/**
@ -58,15 +58,15 @@ class Hooks {
* of the stored versions along the actual file
*/
public static function rename_hook($params) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$oldpath = $params['oldpath'];
$newpath = $params['newpath'];
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
$newpath = $params['newpath'];
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
}
}