var fFroalaAddClass = function (s) { $('.bx-content-description,.cmt-body,.bx-base-text-entity-content').addClass('fr-view'); }; if (typeof glOnProcessHtml === 'undefined') glOnProcessHtml = []; if (glOnProcessHtml instanceof Array) glOnProcessHtml.push(fFroalaAddClass); fFroalaAddClass(); "; } public function actionUpload() { header('Content-Type: application/json; charset=utf-8'); if (!($oStorage = BxDolStorage::getObjectInstance('bx_froala_files'))) { echo json_encode(array('error' => '1')); exit; } $iProfileId = bx_get_logged_profile_id(); if (!($iId = $oStorage->storeFileFromForm($_FILES['file'], false, $iProfileId))) { echo json_encode(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_froala_image'); $sUrl = $oTranscoder->getFileUrl($iId); } else { $sUrl = $oStorage->getFileUrlById($iId); } echo json_encode(array('link' => $sUrl)); } } /** @} */