oWizard->SaveParameter('application_url', ''); $this->oWizard->SaveParameter('graphviz_path', ''); $this->oWizard->SaveParameter('force-uninstall', false); return new WizardState(WizStepModulesChoice::class, 'start_upgrade'); } public function Display(WebPage $oPage) { $sApplicationURL = $this->oWizard->GetParameter('application_url', utils::GetAbsoluteUrlAppRoot(true)); //Preserve existing configuration (except for the str_replace based joker $SERVER_NAME$ which is lost) $sDefaultGraphvizPath = (strtolower(substr(PHP_OS, 0, 3)) === 'win') ? 'C:\\Program Files\\Graphviz\\bin\\dot.exe' : '/usr/bin/dot'; $sGraphvizPath = $this->oWizard->GetParameter('graphviz_path', $sDefaultGraphvizPath); $oPage->add('

Additional parameters

'); $oPage->add('
'); $oPage->add('Application URL'); $oPage->add(''); $oPage->add(''); $oPage->add('
URL:
'); $oPage->add('
Change the value above if the end-users will be accessing the application by another path due to a specific configuration of the web server.
'); $oPage->add('
'); $oPage->add('
'); $oPage->add('Path to Graphviz\' dot application'); $oPage->add(''); $oPage->add(''); $oPage->add(''); $oPage->add('
Path:
'); $oPage->add(''); $oPage->add('
'); $sAuthentToken = $this->oWizard->GetParameter('authent', ''); $oPage->add(''); $oPage->add_ready_script( <<AddUseSymlinksFlagOption($oPage); $this->AddForceUninstallFlagOption($oPage); } public function AsyncAction(WebPage $oPage, $sCode, $aParameters) { switch ($sCode) { case 'check_graphviz': $sGraphvizPath = $aParameters['graphviz_path']; $aCheck = SetupUtils::CheckGraphviz($sGraphvizPath); // N°2214 logging TRACE results $aTraceCheck = CheckResult::FilterCheckResultArray($aCheck, [CheckResult::TRACE]); foreach ($aTraceCheck as $oTraceCheck) { SetupLog::Ok($oTraceCheck->sLabel); } $aNonTraceCheck = array_diff($aCheck, $aTraceCheck); foreach ($aNonTraceCheck as $oCheck) { switch ($oCheck->iSeverity) { case CheckResult::INFO: $sStatus = 'ok'; $sInfoExplanation = $oCheck->sLabel; $sMessage = json_encode('
'.$sInfoExplanation.'
'); break; default: case CheckResult::ERROR: case CheckResult::WARNING: $sStatus = 'ko'; $sErrorExplanation = $oCheck->sLabel; $sMessage = json_encode('
'.$sErrorExplanation.'
'); break; } $oPage->add_ready_script( <<'); } else { $("#v_application_url").html(''); } bGraphviz = ($('#graphviz_path').val() != ''); if (!bGraphviz) { // Does not prevent to move forward $("#v_graphviz_path").html(''); } else { $("#v_graphviz_path").html(''); } return bRet; EOF ; } }