if (empty($clientId) || empty($privateKey) || empty($resultFileId)) { $error = 'Please enter all required parameters'; F3::set('error', $error); } else { //Get base path $basePath = F3::get('POST["basePath"]'); //Set variables for Viewer F3::set('userId', $clientId); F3::set('privateKey', $privateKey); //###Create Signer, ApiClient and Storage Api objects //Create signer object $signer = new GroupDocsRequestSigner($privateKey); //Create apiClient object $apiClient = new APIClient($signer); //Create ComparisonApi object $compareApi = new ComparisonApi($apiClient); if ($basePath == "") { //If base base is empty seting base path to prod server $basePath = 'https://api.groupdocs.com/v2.0'; } //Set base path $compareApi->setBasePath($basePath); //###Make request to ComparisonApi using user id //Get changes list for document try { $info = $compareApi->GetChanges($resultFileId); //Check request status if ($info->status == "Ok") { //###Create table with changes for template $table = "<table class='border'>"; $table .= "<tr><td><font color='green'>Change Name</font></td><td>\n <font color='green'>Change</font></td></tr>";
F3::set('privateKey', $privateKey); //Get entered by user data $sourceFileId = ""; $targetFileId = ""; $firstFileId = F3::get('POST["sourceFileId"]'); $secondFileId = F3::get('POST["targetFileId"]'); $url = F3::get('POST["url"]'); $targetUrl = F3::get('POST["targetUrl"]'); $iframe = ""; //###Create Signer, ApiClient and Storage Api objects //Create signer object $signer = new GroupDocsRequestSigner($privateKey); //Create apiClient object $apiClient = new APIClient($signer); //Create ComparisonApi object $CompareApi = new ComparisonApi($apiClient); //Create Storage Api object $storageApi = new StorageApi($apiClient); $mgmtApi = new MgmtApi($apiClient); if ($basePath == "") { //If base base is empty seting base path to prod server $basePath = 'https://api.groupdocs.com/v2.0'; } //Set base path $CompareApi->setBasePath($basePath); $storageApi->setBasePath($basePath); $mgmtApi->setBasePath($basePath); //Check entered source file GUID and target file GUID if ($firstFileId != "" || $secondFileId != "") { if ($firstFileId != "") { $sourceFileId = $firstFileId;