|
@@ 739-745 (lines=7) @@
|
| 736 |
|
// Moving the file |
| 737 |
|
if ($sourceFileObject instanceof File) { |
| 738 |
|
try { |
| 739 |
|
if ($alternativeName !== '') { |
| 740 |
|
// Don't allow overwriting existing files, but find a new name |
| 741 |
|
$resultObject = $sourceFileObject->moveTo($targetFolderObject, $alternativeName, DuplicationBehavior::RENAME); |
| 742 |
|
} else { |
| 743 |
|
// Don't allow overwriting existing files |
| 744 |
|
$resultObject = $sourceFileObject->moveTo($targetFolderObject, null, DuplicationBehavior::CANCEL); |
| 745 |
|
} |
| 746 |
|
$this->writeLog(3, 0, 1, 'File "%s" moved to "%s"', [$sourceFileObject->getIdentifier(), $resultObject->getIdentifier()]); |
| 747 |
|
$this->addMessageToFlashMessageQueue('FileUtility.FileMovedTo', [$sourceFileObject->getIdentifier(), $resultObject->getIdentifier()], FlashMessage::OK); |
| 748 |
|
} catch (InsufficientUserPermissionsException $e) { |
|
@@ 771-777 (lines=7) @@
|
| 768 |
|
// Else means this is a Folder |
| 769 |
|
$sourceFolderObject = $sourceFileObject; |
| 770 |
|
try { |
| 771 |
|
if ($alternativeName !== '') { |
| 772 |
|
// Don't allow overwriting existing files, but find a new name |
| 773 |
|
$resultObject = $sourceFolderObject->moveTo($targetFolderObject, $alternativeName, DuplicationBehavior::RENAME); |
| 774 |
|
} else { |
| 775 |
|
// Don't allow overwriting existing files |
| 776 |
|
$resultObject = $sourceFolderObject->moveTo($targetFolderObject, null, DuplicationBehavior::RENAME); |
| 777 |
|
} |
| 778 |
|
$this->writeLog(3, 0, 2, 'Directory "%s" moved to "%s"', [$sourceFolderObject->getIdentifier(), $targetFolderObject->getIdentifier()]); |
| 779 |
|
$this->addMessageToFlashMessageQueue('FileUtility.DirectoryMovedTo', [$sourceFolderObject->getIdentifier(), $targetFolderObject->getIdentifier()], FlashMessage::OK); |
| 780 |
|
} catch (InsufficientUserPermissionsException $e) { |