getGhostsWithOrder($iProfileId, $sFormat, $sImagesTranscoder, $iContentId); $aRv = isset($oData['g']) ? [$oData['g'], $oData['o']] : []; return $aRv; break; case 'delete': header('Content-type: text/html; charset=utf-8'); $iFileId = bx_process_input(bx_get('id'), BX_DATA_INT); return $oUploader->deleteGhost($iFileId, $iProfileId); break; case 'upload': if(($aFile = $_FILES['file'] ?? false)) { $aResult = $oUploader->handleUploads($iProfileId, $aFile, $isMultiple, $iContentId, $isPrivate); if(($iId = (int)($aResult['id'] ?? 0)) && ($sImagesTranscoder = bx_get('img_trans')) !== false) { $aGhosts = $oUploader->getGhosts($iProfileId, 'array', bx_process_input($sImagesTranscoder), $iContentId); if(isset($aGhosts[$iId])) $aResult['ghost'] = $aGhosts[$iId]; } return $aResult; } break; case 'upload_inline': $sStorageObject = bx_process_input(bx_get('o')); $sFile = bx_process_input(bx_get('f')); $oStorage = BxDolStorage::getObjectInstance($sStorageObject); if (!($iId = $oStorage->storeFileFromForm($_FILES['file'], false, $iProfileId))) { return array('error' => '1'); exit; } $oStorage->afterUploadCleanup($iId, $iProfileId); $aFileInfo = $oStorage->getFile($iId); if ($aFileInfo && in_array($aFileInfo['ext'], array('jpg', 'jpeg', 'jpe', 'png'))) { $oTranscoder = BxDolTranscoderImage::getObjectInstance(bx_get('t')); $sUrl = $oTranscoder->getFileUrl($iId); } else { $sUrl = $oStorage->getFileUrlById($iId); } return ['link' => $sUrl]; break; } } } /** @} */