function RenderCommandLog() { global $Commands; $renderLog = ""; foreach ($Commands as $loggedCommand) { $renderLog .= RenderParagraph($loggedCommand["Command"], "command"); $renderLog .= RenderParagraph($loggedCommand["Result"]); $renderLog .= RenderParagraph($loggedCommand["Error"], "error"); } return RenderDiv("divConsoleContainer", RenderButton("btnToggle", "Log", "Element_ToggleVisibility('divConsole');return false;") . RenderDiv("divConsole", $renderLog, null, "display:none;")); }
if ($Crop) { CropImage($DestFile); } MoveToDest($DestFile); $timeNow = time() + microtime(); $timings->RegisterTiming($CurrentKey, $timeNow - $timeThen); } // Pass the JSON object of timings to client echo "<script>\n"; echo "var timings="; echo json_encode($timings->GetTimingsAverage(), JSON_PRETTY_PRINT); echo ";\n"; echo "</script>\n"; // Render Form $formFields = ""; $formFields .= RenderFieldInfo(MultiLang::GetString("Scanner"), $Scanner["ScanModel"]); $formFields .= RenderFieldCombo(MultiLang::GetString("Resolution"), "ddlResolution", $Resolutions, $Resolution); $formFields .= RenderFieldCombo(MultiLang::GetString("Format"), "ddlFormat", $Formats, $Format); $formFields .= RenderFieldCombo(MultiLang::GetString("Size"), "ddlSize", MultiLang::ApplyArrayKeys($Sizes), $Size); //$formFields.=RenderFieldCheckText("Cropping","chkCrop",$Crop,"txtCropFuzz",$CropFuzz); $formFields .= RenderFieldText(MultiLang::GetString("Prefix"), "txtPrefix", $Prefix); $formFields .= RenderFieldButton("", "btnScan", MultiLang::GetString("Scan"), "ShowProgressDialog();"); $formFields .= RenderFieldLinkButton("", "btnDownload", MultiLang::GetString("Download"), $DestFile, pathinfo($DestFile)["basename"], ""); $formFields .= RenderHidden("hidScanDevice", $Scanner["ScanDevice"]); $formFields .= RenderHidden("hidScanModel", $Scanner["ScanModel"]); $columns = ""; $columns .= renderDiv("divColLeft", $formFields); $columns .= renderDiv("divColRight", RenderDocument($DestFile)); $columns .= RenderCommandLog(); $columns .= RenderDiv("divLoadBack", RenderDiv("divLoading", MultiLang::GetString("Loading") . RenderDiv("divProgressCont", RenderDiv("divProgressBar", "", "divProgressBar"), "divProgressCont"), "divLoading"), "divLoadBack", "display:none;"); echo RenderForm("frmMain", $columns);