- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/diskstorage.php
- Класс: CDiskStorage
- Вызов: CDiskStorage::renameDirectory
public function renameDirectory($name, $targetDirectoryId, $parentDirectoryId)
{
/** @var Folder $sourceFolder */
$sourceFolder = Folder::loadById($targetDirectoryId);
if(!$sourceFolder)
{
$this->errorCollection->add(array(new Error("Could not " . __METHOD__ . " by id {$targetDirectoryId}", 111602)));
return false;
}
if(!$sourceFolder->canRename($this->storage->getCurrentUserSecurityContext()))
{
throw new CWebDavAccessDeniedException;
}
if($sourceFolder->rename($name, $this->getUser()->getId()))
{
$this->loadFormattedFolderTreeAndBreadcrumbs();
return $this->getDirectory(null, array('id' => $sourceFolder->getId()), true);
}
$this->errorCollection->add(array(new Error("Could not " . __METHOD__ . ", rename", 111603)));
$this->errorCollection->add($sourceFolder->getErrors());
return array();
}