$sModules = implode(', ', get_loaded_extensions()); // Get the datamodel directory $oFilter = DBObjectSearch::FromOQL('SELECT ModuleInstallation WHERE name="datamodel"'); $oSet = new DBObjectSet($oFilter, array('installed' => false)); // Most recent first $oLastInstall = $oSet->Fetch(); $sLastInstallDate = $oLastInstall->Get('installed'); $sDataModelVersion = $oLastInstall->Get('version'); $aDataModelInfo = json_decode($oLastInstall->Get('comment'), true); $sDataModelSourceDir = $aDataModelInfo['source_dir']; require_once APPROOT . 'setup/runtimeenv.class.inc.php'; $sCurrEnv = utils::GetCurrentEnvironment(); $oRuntimeEnv = new RunTimeEnvironment($sCurrEnv); $aAvailableModules = $oRuntimeEnv->AnalyzeInstallation(MetaModel::GetConfig(), array(APPROOT . $sDataModelSourceDir, APPROOT . 'extensions')); require_once APPROOT . 'setup/setuputils.class.inc.php'; $aLicenses = SetupUtils::GetLicenses(); $aItopSettings = array('cron_max_execution_time', 'timezone'); $aPHPSettings = array('memory_limit', 'max_execution_time', 'upload_max_filesize', 'post_max_size'); $aMySQLSettings = array('max_allowed_packet', 'key_buffer_size', 'query_cache_size'); $aMySQLStatuses = array('Key_read_requests', 'Key_reads'); if (extension_loaded('suhosin')) { $aPHPSettings[] = 'suhosin.post.max_vars'; $aPHPSettings[] = 'suhosin.get.max_value_length'; } $aMySQLVars = array(); foreach (CMDBSource::QueryToArray('SHOW VARIABLES') as $aRow) { $aMySQLVars[$aRow['Variable_name']] = $aRow['Value']; } $aMySQLStats = array(); foreach (CMDBSource::QueryToArray('SHOW GLOBAL STATUS') as $aRow) { $aMySQLStats[$aRow['Variable_name']] = $aRow['Value'];
public function Display(WebPage $oPage) { $aLicenses = SetupUtils::GetLicenses(); $oPage->add('<h2>Licenses agreements for the components of ' . ITOP_APPLICATION . '</h2>'); $oPage->add_style('div a.no-arrow { background:transparent; padding-left:0;}'); $oPage->add_style('.toggle { cursor:pointer; text-decoration:underline; color:#1C94C4; }'); $oPage->add('<fieldset>'); $oPage->add('<legend>Components of ' . ITOP_APPLICATION . '</legend>'); $oPage->add('<ul>'); foreach ($aLicenses as $index => $oLicense) { $oPage->add('<li><b>' . $oLicense->product . '</b>, © ' . $oLicense->author . ' is licensed under the <b>' . $oLicense->license_type . ' license</b>. (<span class="toggle" id="toggle_' . $index . '">Details</span>)'); $oPage->add('<div id="license_' . $index . '" class="license_text" style="display:none;overflow:auto;max-height:10em;font-size:small;border:1px #696969 solid;margin-bottom:1em; margin-top:0.5em;padding:0.5em;">' . $oLicense->text . '</div>'); $oPage->add_ready_script('$(".license_text a").attr("target", "_blank").addClass("no-arrow");'); $oPage->add_ready_script('$("#toggle_' . $index . '").click( function() { $("#license_' . $index . '").toggle(); } );'); } $oPage->add('</ul>'); $oPage->add('</fieldset>'); $sChecked = $this->oWizard->GetParameter('accept_license', 'no') == 'yes' ? ' checked ' : ''; $oPage->p('<input type="checkbox" name="accept_license" id="accept" value="yes"' . $sChecked . '><label for="accept"> I accept the terms of the licenses of the ' . count($aLicenses) . ' components mentioned above.</label>'); $oPage->add_ready_script('$("#accept").bind("click change", function() { WizardUpdateButtons(); });'); }