public function AsyncAction(WebPage $oPage, $sCode, $aParameters) { $oParameters = new PHPParameters(); $sStep = $aParameters['installer_step']; $sJSONParameters = $aParameters['installer_config']; $oParameters->LoadFromHash(json_decode($sJSONParameters, true)); $oInstaller = new ApplicationInstaller($oParameters); $aRes = $oInstaller->ExecuteStep($sStep); if ($aRes['status'] != ApplicationInstaller::ERROR && $aRes['next-step'] != '') { // Tell the web page to move the progress bar and to launch the next step $sMessage = addslashes(htmlentities($aRes['next-step-label'], ENT_QUOTES, 'UTF-8')); $oPage->add_ready_script(<<<EOF \t\$("#wiz_form").data("installation_status", "running"); \tWizardUpdateButtons(); \t\$('#setup_msg').html('{$sMessage}'); \t\$('#progress').progression( {Current:{$aRes['percentage-completed']}, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} ); \t \t//\$("#percentage").html('{$aRes['percentage-completed']} % completed<br/>{$aRes['next-step-label']}'); \tExecuteStep('{$aRes['next-step']}'); EOF ); } else { if ($aRes['status'] != ApplicationInstaller::ERROR) { // Installation complete, move to the next step of the wizard $oPage->add_ready_script(<<<EOF \t\$("#wiz_form").data("installation_status", "completed"); \t\$('#progress').progression( {Current:100, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} ); \tWizardUpdateButtons(); \t\$("#btn_next").unbind("click.install"); \t\$("#btn_next").click(); EOF ); } else { $sMessage = addslashes(htmlentities($aRes['message'], ENT_QUOTES, 'UTF-8')); $oPage->add_ready_script(<<<EOF \t\$("#wiz_form").data("installation_status", "error"); \tWizardUpdateButtons(); \t\$('#setup_msg').html('{$sMessage}'); EOF ); } } }