Example #1
0
 public function AjaxFilesRename()
 {
     $oAccount = $this->getDefaultAccountFromParam();
     if (!$this->oApiCapability->IsFilesSupported($oAccount)) {
         throw new \ProjectSeven\Exceptions\ClientException(\ProjectSeven\Notifications::FilesNotAllowed);
     }
     $iType = (int) $this->getParamValue('Type');
     $sPath = $this->getParamValue('Path');
     $sName = $this->getParamValue('Name');
     $sNewName = $this->getParamValue('NewName');
     $oResult = null;
     $sNewName = $this->oApiFilestorage->GetNonExistingFileName($oAccount, $iType, $sPath, $sNewName);
     $oResult = $this->oApiFilestorage->Rename($oAccount, $iType, $sPath, $sName, $sNewName);
     return $this->DefaultResponse($oAccount, __FUNCTION__, $oResult);
 }