fix files_version hooks

remotes/origin/stable5
Robin Appelman 12 years ago
parent 7207211f3a
commit 929b8c3e69
  1. 34
      apps/files_versions/lib/hooks.php

@ -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 );
}
}

Loading…
Cancel
Save