apps/activity/lib/FilesHooks.php
/**
	 * Collect some information for move/renames
	 *
	 * @param string $oldPath Path of the file that has been moved
	 * @param string $newPath Path of the file that has been moved
	 */
Collect some information for move/renames
@param string $oldPath Path of the file that has been moved
@param string $newPath Path of the file that has been moved
Collect some information for move / renames @param string $oldPath Path of the file that has been moved @param string $newPath Path of the file that has been moved
public function fileMove($oldPath, $newPath) {
		if (substr($oldPath, -5) === '.part' || substr($newPath, -5) === '.part') {
			$this->moveCase = false;
			return;
		}
		$oldDir = dirname($oldPath);
		$newDir = dirname($newPath);
		if ($oldDir === $newDir) {
			$this->moveCase = 'rename';
			return;
		}
		if (strpos($oldDir, $newDir) === 0) {
			$this->moveCase = 'moveUp';
		} else if (strpos($newDir, $oldDir) === 0) {
			$this->moveCase = 'moveDown';
		} else {
			$this->moveCase = 'moveCross';
		}
		list($this->oldParentPath, $this->oldParentOwner, $this->oldParentId) = $this->getSourcePathAndOwner($oldDir);
		if ($this->oldParentId === 0) {
			$this->moveCase = false;
			return;
		}
		$this->oldAccessList = $this->getUserPathsFromPath($this->oldParentPath, $this->oldParentOwner);
	}
public function fileMove ( $ oldPath , $ newPath ) { if ( substr ( $ oldPath , - 5 ) === '.part' || substr ( $ newPath , - 5 ) === '.part' ) { $ this -> moveCase = false ; return ; } $ oldDir = dirname ( $ oldPath ) ; $ newDir = dirname ( $ newPath ) ; if ( $ oldDir === $ newDir ) { $ this -> moveCase = 'rename' ; return ; } if ( strpos ( $ oldDir , $ newDir ) === 0 ) { $ this -> moveCase = 'moveUp' ; } else if ( strpos ( $ newDir , $ oldDir ) === 0 ) { $ this -> moveCase = 'moveDown' ; } else { $ this -> moveCase = 'moveCross' ; } list ( $ this -> oldParentPath , $ this -> oldParentOwner , $ this -> oldParentId ) = $ this -> getSourcePathAndOwner ( $ oldDir ) ; if ( $ this -> oldParentId === 0 ) { $ this -> moveCase = false ; return ; } $ this -> oldAccessList = $ this -> getUserPathsFromPath ( $ this -> oldParentPath , $ this -> oldParentOwner ) ; }
Collect some information for move/renames
 @param string $oldPath Path of the file that has been moved
 @param string $newPath Path of the file that has been moved
Collect some information for move / renames @param string $oldPath Path of the file that has been moved @param string $newPath Path of the file that has been moved
// Do not add activities for .part-files /**
			 * a/b moved to a/c
			 *
			 * Cases:
			 * - a/b shared: no visible change
			 * - a/ shared: rename
			 */ /**
			 * a/b/c moved to a/c
			 *
			 * Cases:
			 * - a/b/c shared: no visible change
			 * - a/b/ shared: delete
			 * - a/ shared: move/rename
			 */ /**
			 * a/b moved to a/c/b
			 *
			 * Cases:
			 * - a/b shared: no visible change
			 * - a/c/ shared: add
			 * - a/ shared: move/rename
			 */ /**
			 * a/b/c moved to a/d/c
			 *
			 * Cases:
			 * - a/b/c shared: no visible change
			 * - a/b/ shared: delete
			 * - a/d/ shared: add
			 * - a/ shared: move/rename
			 */ // Could not find the file for the owner ...