oWizard->SaveParameter('default_language', ''); $this->oWizard->SaveParameter('application_url', ''); $this->oWizard->SaveParameter('graphviz_path', ''); $this->oWizard->SaveParameter('sample_data', 'yes'); return new WizardState(WizStepModulesChoice::class, 'start_install'); } public function Display(WebPage $oPage) { $sDefaultLanguage = $this->oWizard->GetParameter('default_language', $this->oWizard->GetParameter('admin_language')); $sApplicationURL = $this->oWizard->GetParameter('application_url', utils::GetDefaultUrlAppRoot(true)); $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); $sSampleData = $this->oWizard->GetParameter('sample_data', 'yes'); $oPage->add('

Additional parameters

'); $oPage->add('
'); $oPage->add('Default Language'); $oPage->add(''); $sSourceDir = APPROOT.'dictionaries/'; $aLanguages = SetupUtils::GetAvailableLanguages($sSourceDir); $oPage->add(''); $oPage->add('
Default Language: '); $oPage->add(SetupUtils::GetLanguageSelect($sSourceDir, 'default_language', $sDefaultLanguage)); $oPage->add('
'); $oPage->add('
'); $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('
'); $oPage->add('
'); $oPage->add('Sample Data'); $sChecked = ($sSampleData == 'yes') ? 'checked ' : ''; $oPage->p('
'); $sAuthentToken = $this->oWizard->GetParameter('authent', ''); $oPage->add(''); $oPage->add_ready_script( <<AddUseSymlinksFlagOption($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; } if ($oCheck->iSeverity !== CheckResult::TRACE) { $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 ; } }