public function Display(WebPage $oPage) { // Store the misc_options for the future... $aMiscOptions = utils::ReadParam('option', array(), false, 'raw_data'); $sMiscOptions = $this->oWizard->GetParameter('misc_options', json_encode($aMiscOptions)); $this->oWizard->SetParameter('misc_options', $sMiscOptions); $oPage->add("<!--[if lt IE 8]><div id=\"old_ie\"></div><![endif]-->"); $oPage->add_ready_script(<<<EOF \t\tif (\$('#old_ie').length > 0) \t\t{ \t\t\talert("Internet Explorer version 7 or older is NOT supported! (Check that IE is not running in compatibility mode)"); \t\t} EOF ); $oPage->add('<h1>' . ITOP_APPLICATION . ' Installation Wizard</h1>'); $aResults = SetupUtils::CheckPHPVersion($oPage); $this->bCanMoveForward = true; $aInfo = array(); $aWarnings = array(); $aErrors = array(); foreach ($aResults as $oCheckResult) { switch ($oCheckResult->iSeverity) { case CheckResult::ERROR: $aErrors[] = $oCheckResult->sLabel; $this->bCanMoveForward = false; break; case CheckResult::WARNING: $aWarnings[] = $oCheckResult->sLabel; break; case CheckResult::INFO: $aInfo[] = $oCheckResult->sLabel; break; } } $sStyle = 'style="display:none;max-height:196px;overflow:auto;"'; $sToggleButtons = '<button type="button" id="show_details" onclick="$(\'#details\').toggle(); $(this).toggle(); $(\'#hide_details\').toggle();">Show details</button><button type="button" id="hide_details" style="display:none;" onclick="$(\'#details\').toggle(); $(this).toggle(); $(\'#show_details\').toggle();">Hide details</button>'; if (count($aErrors) > 0) { $sStyle = 'style="max-height:196px;overflow:auto;"'; $sImage = "stop-mid.png"; $sTitle = count($aErrors) . ' Error(s), ' . count($aWarnings) . ' Warning(s).'; } else { if (count($aWarnings) > 0) { $sTitle = count($aWarnings) . ' Warning(s) ' . $sToggleButtons; $sImage = "messagebox_warning-mid.png"; } else { $sTitle = 'Ok. ' . $sToggleButtons; $sImage = "clean-mid.png"; } } $oPage->add('<h2>Prerequisites validation: '); $oPage->add("<img style=\"vertical-align:middle;\" src=\"../images/{$sImage}\"> "); $oPage->add($sTitle); $oPage->add('</h2>'); $oPage->add('<div id="details" ' . $sStyle . '>'); foreach ($aErrors as $sText) { $oPage->error($sText); } foreach ($aWarnings as $sText) { $oPage->warning($sText); } foreach ($aInfo as $sText) { $oPage->ok($sText); } $oPage->add('</div>'); if (!$this->bCanMoveForward) { $oPage->p('Sorry, the installation cannot continue. Please fix the errors and reload this page to launch the installation again.'); } }