diff --git a/datamodels/2.x/itop-hub-connector/launch.php b/datamodels/2.x/itop-hub-connector/launch.php index 5e042c734a..2bca313f09 100644 --- a/datamodels/2.x/itop-hub-connector/launch.php +++ b/datamodels/2.x/itop-hub-connector/launch.php @@ -27,7 +27,7 @@ /** * Collect the configuration information to be posted to the hub - * + * * @return string[][] */ @@ -104,17 +104,18 @@ * Return a cleaned (i.e. * properly truncated) versin number from * a very long version number like "7.0.18-0unbuntu0-16.04.1" - * + * * @param string $sString + * * @return string */ function CleanVersionNumber($sString) { $aMatches = array(); - if (preg_match("|^([0-9\\.]+)-|", $sString, $aMatches)) - { + if (preg_match("|^([0-9\\.]+)-|", $sString, $aMatches)) { return $aMatches[1]; } + return $sString; } @@ -123,260 +124,234 @@ function collect_configuration() $aConfiguration = array( 'php' => array(), 'mysql' => array(), - 'apache' => array() + 'apache' => array(), ); - + // Database information $m_oMysqli = CMDBSource::GetMysqli(); - $aConfiguration['database_settings']['server'] = (string) $m_oMysqli->server_version; - $aConfiguration['database_settings']['client'] = (string) $m_oMysqli->client_version; - + $aConfiguration['database_settings']['server'] = (string)$m_oMysqli->server_version; + $aConfiguration['database_settings']['client'] = (string)$m_oMysqli->client_version; + /** @var mysqli_result $resultSet */ $result = CMDBSource::Query('SHOW VARIABLES LIKE "%max_allowed_packet%"'); - if ($result) - { + if ($result) { $row = $result->fetch_object(); - $aConfiguration['database_settings']['max_allowed_packet'] = (string) $row->Value; + $aConfiguration['database_settings']['max_allowed_packet'] = (string)$row->Value; } - + /** @var mysqli_result $resultSet */ $result = CMDBSource::Query('SHOW VARIABLES LIKE "%version_comment%"'); - if ($result) - { + if ($result) { $row = $result->fetch_object(); - if (preg_match('/mariadb/i', $row->Value)) - { + if (preg_match('/mariadb/i', $row->Value)) { $aConfiguration['database_name'] = 'MariaDB'; } } - + // Web server information - if (function_exists('apache_get_version')) - { + if (function_exists('apache_get_version')) { $aConfiguration['web_server_name'] = 'apache'; $aConfiguration['web_server_version'] = apache_get_version(); - } - else - { + } else { // The format of the variable $_SERVER["SERVER_SOFTWARE"] seems to be the following: // PHP 7 FPM with Apache on Ubuntu: "Apache/2.4.18 (Ubuntu)" // IIS 7.5 on Windows 7: "Microsoft-IIS/7.5" // Nginx with PHP FPM on Ubuntu: "nginx/1.10.0" $aConfiguration['web_server_name'] = substr($_SERVER["SERVER_SOFTWARE"], 0, strpos($_SERVER["SERVER_SOFTWARE"], '/')); - $sWebServerVersion = trim(substr($_SERVER["SERVER_SOFTWARE"], 1+strpos($_SERVER["SERVER_SOFTWARE"], '/'))); - if ($sWebServerVersion == '') - { + $sWebServerVersion = trim(substr($_SERVER["SERVER_SOFTWARE"], 1 + strpos($_SERVER["SERVER_SOFTWARE"], '/'))); + if ($sWebServerVersion == '') { $sWebServerVersion = 'Unknown'; } $aConfiguration['web_server_version'] = $sWebServerVersion; } - + // PHP extensions - if (!MetaModel::GetConfig()->GetModuleSetting('itop-hub-connector', 'php_extensions_enable', true)) - { + if (!MetaModel::GetConfig()->GetModuleSetting('itop-hub-connector', 'php_extensions_enable', true)) { $aConfiguration['php_extensions'] = array(); - } - else - { - foreach (get_loaded_extensions() as $extension) - { + } else { + foreach (get_loaded_extensions() as $extension) { $aConfiguration['php_extensions'][$extension] = $extension; } } - + // Collect some PHP settings having a known impact on iTop $aIniGet = MetaModel::GetConfig()->GetModuleSetting('itop-hub-connector', 'php_settings_array', array()); // by default, on the time of the writting, it values are : array('post_max_size', 'upload_max_filesize', 'apc.enabled', 'timezone', 'memory_limit', 'max_execution_time'); $aConfiguration['php_settings'] = array(); - foreach ($aIniGet as $iniGet) - { - $aConfiguration['php_settings'][$iniGet] = (string) ini_get($iniGet); + foreach ($aIniGet as $iniGet) { + $aConfiguration['php_settings'][$iniGet] = (string)ini_get($iniGet); } - + // iTop modules $oConfig = MetaModel::GetConfig(); $sLatestInstallationDate = CMDBSource::QueryToScalar("SELECT max(installed) FROM ".$oConfig->Get('db_subname')."priv_module_install"); // Get the latest installed modules, without the "root" ones (iTop version and datamodel version) $aInstalledModules = CMDBSource::QueryToArray("SELECT * FROM ".$oConfig->Get('db_subname')."priv_module_install WHERE installed = '".$sLatestInstallationDate."' AND parent_id != 0"); - - foreach ($aInstalledModules as $aDBInfo) - { + + foreach ($aInstalledModules as $aDBInfo) { $aConfiguration['itop_modules'][$aDBInfo['name']] = $aDBInfo['version']; } - + // iTop Installation Options, i.e. "Extensions" $oExtensionMap = new iTopExtensionsMap(); $oExtensionMap->LoadChoicesFromDatabase($oConfig); $aConfiguration['itop_extensions'] = array(); - foreach ($oExtensionMap->GetChoices() as $oExtension) - { - switch ($oExtension->sSource) - { + foreach ($oExtensionMap->GetChoices() as $oExtension) { + switch ($oExtension->sSource) { case iTopExtension::SOURCE_MANUAL: case iTopExtension::SOURCE_REMOTE: - $aConfiguration['itop_extensions'][$oExtension->sCode] = array( - 'label' => $oExtension->sLabel, - 'value' => $oExtension->sInstalledVersion - ); - break; - + $aConfiguration['itop_extensions'][$oExtension->sCode] = array( + 'label' => $oExtension->sLabel, + 'value' => $oExtension->sInstalledVersion, + ); + break; + default: - $aConfiguration['itop_installation_options'][$oExtension->sCode] = array( - 'label' => $oExtension->sLabel, - 'value' => true - ); + $aConfiguration['itop_installation_options'][$oExtension->sCode] = array( + 'label' => $oExtension->sLabel, + 'value' => true, + ); } } + return $aConfiguration; } function MakeDataToPost($sTargetRoute) { - if (MetaModel::GetConfig()->Get('demo_mode')) - { + if (MetaModel::GetConfig()->Get('demo_mode')) { // Don't expose such information in demo mode $aDataToPost = array('disabled' => true, 'reason' => 'demo_mode'); - } - else - { + } else { $aConfiguration = collect_configuration(); - + $aDataToPost = array( 'itop_hub_target_route' => $sTargetRoute, 'itop_stack' => array( - "uuidBdd" => (string) trim(DBProperty::GetProperty('database_uuid', ''), '{}'), // TODO check if empty and... regenerate a new UUID ?? - "uuidFile" => (string) trim(@file_get_contents(APPROOT."data/instance.txt"), "{} \n"), // TODO check if empty and... regenerate a new UUID ?? - 'instance_friendly_name' => (string) $_SERVER['SERVER_NAME'], - 'instance_host' => (string) utils::GetAbsoluteUrlAppRoot(), - 'application_name' => (string) ITOP_APPLICATION, - 'application_version' => (string) ITOP_VERSION, - 'application_version_full' => (string) Dict::Format('UI:iTopVersion:Long', ITOP_APPLICATION, ITOP_VERSION, ITOP_REVISION, ITOP_BUILD_DATE), - 'itop_user_id' => (string) (UserRights::GetUserId()===null) ? "1" : UserRights::GetUserId(), - 'itop_user_lang' => (string) UserRights::GetUserLanguage(), - 'itop_modules' => (object) $aConfiguration['itop_modules'], - 'itop_extensions' => (object) $aConfiguration['itop_extensions'], - 'itop_installation_options' => (object) $aConfiguration['itop_installation_options'] + "uuidBdd" => (string)trim(DBProperty::GetProperty('database_uuid', ''), '{}'), // TODO check if empty and... regenerate a new UUID ?? + "uuidFile" => (string)trim(@file_get_contents(APPROOT."data/instance.txt"), "{} \n"), // TODO check if empty and... regenerate a new UUID ?? + 'instance_friendly_name' => (string)$_SERVER['SERVER_NAME'], + 'instance_host' => (string)utils::GetAbsoluteUrlAppRoot(), + 'application_name' => (string)ITOP_APPLICATION, + 'application_version' => (string)ITOP_VERSION, + 'application_version_full' => (string)Dict::Format('UI:iTopVersion:Long', ITOP_APPLICATION, ITOP_VERSION, ITOP_REVISION, ITOP_BUILD_DATE), + 'itop_user_id' => (string)(UserRights::GetUserId() === null) ? "1" : UserRights::GetUserId(), + 'itop_user_lang' => (string)UserRights::GetUserLanguage(), + 'itop_modules' => (object)$aConfiguration['itop_modules'], + 'itop_extensions' => (object)$aConfiguration['itop_extensions'], + 'itop_installation_options' => (object)$aConfiguration['itop_installation_options'], ), 'server_stack' => array( - 'os_name' => (string) PHP_OS, - 'web_server_name' => (string) $aConfiguration['web_server_name'], - 'web_server_version' => (string) $aConfiguration['web_server_version'], - 'database_name' => (string) isset($aConfiguration['database_name']) ? $aConfiguration['database_name'] : 'MySQL', // if we do not detect MariaDB, we assume this is mysql - 'database_version' => (string) CMDBSource::GetDBVersion(), - 'database_settings' => (object) $aConfiguration['database_settings'], - 'php_version' => (string) CleanVersionNumber(phpversion()), - 'php_settings' => (object) $aConfiguration['php_settings'], - 'php_extensions' => (object) $aConfiguration['php_extensions'] - ) + 'os_name' => (string)PHP_OS, + 'web_server_name' => (string)$aConfiguration['web_server_name'], + 'web_server_version' => (string)$aConfiguration['web_server_version'], + 'database_name' => (string)isset($aConfiguration['database_name']) ? $aConfiguration['database_name'] : 'MySQL', // if we do not detect MariaDB, we assume this is mysql + 'database_version' => (string)CMDBSource::GetDBVersion(), + 'database_settings' => (object)$aConfiguration['database_settings'], + 'php_version' => (string)CleanVersionNumber(phpversion()), + 'php_settings' => (object)$aConfiguration['php_settings'], + 'php_extensions' => (object)$aConfiguration['php_extensions'], + ), ); } + return $aDataToPost; } -try -{ - require_once (APPROOT.'/application/application.inc.php'); - require_once (APPROOT.'/application/itopwebpage.class.inc.php'); - require_once (APPROOT.'/setup/extensionsmap.class.inc.php'); - require_once ('hubconnectorpage.class.inc.php'); - - require_once (APPROOT.'/application/startup.inc.php'); - +try { + require_once(APPROOT.'/application/application.inc.php'); + require_once(APPROOT.'/application/itopwebpage.class.inc.php'); + require_once(APPROOT.'/setup/extensionsmap.class.inc.php'); + require_once('hubconnectorpage.class.inc.php'); + + require_once(APPROOT.'/application/startup.inc.php'); + $sTargetRoute = utils::ReadParam('target', ''); // ||browse_extensions|deploy_extensions| - - if ($sTargetRoute != 'inform_after_setup') - { - require_once (APPROOT.'/application/loginwebpage.class.inc.php'); + + if ($sTargetRoute != 'inform_after_setup') { + require_once(APPROOT.'/application/loginwebpage.class.inc.php'); LoginWebPage::DoLoginEx(null, true /* $bMustBeAdmin */); // Check user rights and prompt if needed } - + $sHubUrlStateless = MetaModel::GetModuleSetting('itop-hub-connector', 'url').MetaModel::GetModuleSetting('itop-hub-connector', 'route_landing_stateless'); $sHubUrl = MetaModel::GetModuleSetting('itop-hub-connector', 'url').MetaModel::GetModuleSetting('itop-hub-connector', 'route_landing'); - + // Display... or not... the page - - switch ($sTargetRoute) - { + + switch ($sTargetRoute) { case 'inform_after_setup': - // Hidden IFRAME at the end of the setup - require_once (APPROOT.'/application/ajaxwebpage.class.inc.php'); - $oPage = new NiceWebPage(''); - $aDataToPost = MakeDataToPost($sTargetRoute); - $oPage->add('
'); - $oPage->add(''); - $oPage->add_ready_script('$("#hub_launch_form").submit();'); - break; - + // Hidden IFRAME at the end of the setup + require_once(APPROOT.'/application/ajaxwebpage.class.inc.php'); + $oPage = new NiceWebPage(''); + $aDataToPost = MakeDataToPost($sTargetRoute); + $oPage->add(''); + $oPage->add(''); + $oPage->add_ready_script('$("#hub_launch_form").submit();'); + break; + default: - // All other cases, special "Hub like" web page - if ($sTargetRoute == 'view_dashboard') - { - $sTitle = Dict::S('Menu:iTopHub:Register'); - $sLabel = Dict::S('Menu:iTopHub:Register+'); - $sText = Dict::S('Menu:iTopHub:Register:Description'); - } - else - { - $sTitle = Dict::S('Menu:iTopHub:BrowseExtensions'); - $sLabel = Dict::S('Menu:iTopHub:BrowseExtensions+'); - $sText = Dict::S('Menu:iTopHub:BrowseExtensions:Description'); - } - $sLogoUrl = utils::GetAbsoluteUrlModulesRoot().'/itop-hub-connector/images/itophub-logo.svg'; - $sArrowUrl = utils::GetAbsoluteUrlModulesRoot().'/itop-hub-connector/images/white-arrow-right.svg'; - $sCloseUrl = utils::GetAbsoluteUrlModulesRoot().'/itop-hub-connector/images/black-close.svg'; - - $oPage = new HubConnectorPage(Dict::S('iTopHub:Connect')); - $oPage->add_linked_script(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/js/hub.js'); - $oPage->add_linked_stylesheet('../css/font-combodo/font-combodo.css'); - $oPage->add_linked_stylesheet(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/css/hub.css'); - - $aDataToPost = MakeDataToPost($sTargetRoute); - - if (MetaModel::GetConfig()->Get('demo_mode')) - { - $oPage->add("
Sorry, iTop is in demonstration mode: the connection to iTop Hub is disabled.
"); - } - - $oPage->add('
'); - $oPage->add('
'); - $oPage->add('
'); - $oPage->add('
'); - $oPage->add(file_get_contents(__DIR__.'/images/rocket.svg')); - $oPage->add('
'); - $oPage->add('

'.$sTitle.'

'); - $oPage->add($sText); - $oPage->add('

'); - $sFormTarget = appUserPreferences::GetPref('itophub_open_in_new_window', 1) ? 'target="_blank"' : ''; - $oPage->add(''); - $oPage->add(''); - - // $sNewWindowChecked = appUserPreferences::GetPref('itophub_open_in_new_window', 1) == 1 ? 'checked' : ''; - // $oPage->add('


'); - - // Beware the combination auto-submit and open in new window (cf above) is blocked by (some) browsers (namely Chrome) - $sAutoSubmitChecked = appUserPreferences::GetPref('itophub_auto_submit', 0)==1 ? 'checked' : ''; - $oPage->add('

'); - $oPage->add(''); - $oPage->add('
'); - $oPage->add('
'); - $oPage->add('
'); - - $oPage->add_ready_script('$(".userpref").on("click", function() { var value = $(this).prop("checked") ? 1 : 0; var code = $(this).attr("id"); SetUserPreference(code, value, true); });'); - if (MetaModel::GetConfig()->Get('demo_mode')) - { - $oPage->add_ready_script( -<<add_linked_script(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/js/hub.js'); + $oPage->add_linked_stylesheet('../css/font-combodo/font-combodo.css'); + $oPage->add_linked_stylesheet(utils::GetAbsoluteUrlModulesRoot().'itop-hub-connector/css/hub.css'); + + $aDataToPost = MakeDataToPost($sTargetRoute); + + if (MetaModel::GetConfig()->Get('demo_mode')) { + $oPage->add("
Sorry, iTop is in demonstration mode: the connection to iTop Hub is disabled.
"); + } + + $oPage->add('
'); + $oPage->add('
'); + $oPage->add('
'); + $oPage->add('
'); + $oPage->add(file_get_contents(__DIR__.'/images/rocket.svg')); + $oPage->add('
'); + $oPage->add('

'.$sTitle.'

'); + $oPage->add($sText); + $oPage->add('

'); + $sFormTarget = appUserPreferences::GetPref('itophub_open_in_new_window', 1) ? 'target="_blank"' : ''; + $oPage->add('
'); + $oPage->add(''); + + // $sNewWindowChecked = appUserPreferences::GetPref('itophub_open_in_new_window', 1) == 1 ? 'checked' : ''; + // $oPage->add('


'); + + // Beware the combination auto-submit and open in new window (cf above) is blocked by (some) browsers (namely Chrome) + $sAutoSubmitChecked = appUserPreferences::GetPref('itophub_auto_submit', 0) == 1 ? 'checked' : ''; + $oPage->add('

'); + $oPage->add('
'); + $oPage->add('
'); + $oPage->add('
'); + $oPage->add('
'); + + $oPage->add_ready_script('$(".userpref").on("click", function() { var value = $(this).prop("checked") ? 1 : 0; var code = $(this).attr("id"); SetUserPreference(code, value, true); });'); + if (MetaModel::GetConfig()->Get('demo_mode')) { + $oPage->add_ready_script( + <<add_ready_script( -<<add_ready_script( + <<add_ready_script('$("#GoToHubBtn").trigger("click");'); - } - - if (utils::ReadParam('show-json', false)) - { - $oPage->add('

DEBUG : json

'); - $oPage->add('
'.json_encode($aDataToPost, JSON_PRETTY_PRINT).'
'); - } +JS + ); + } + + if (appUserPreferences::GetPref('itophub_auto_submit', 0) == 1) { + $oPage->add_ready_script('$("#GoToHubBtn").trigger("click");'); + } + + if (utils::ReadParam('show-json', false)) { + $oPage->add('

DEBUG : json

'); + $oPage->add('
'.json_encode($aDataToPost, JSON_PRETTY_PRINT).'
'); + } } - + $oPage->output(); } -catch (CoreException $e) -{ - require_once (APPROOT.'/setup/setuppage.class.inc.php'); +catch (CoreException $e) { + require_once(APPROOT.'/setup/setuppage.class.inc.php'); $oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError')); $oP->add("

".Dict::S('UI:FatalErrorMessage')."

\n"); $oP->error(Dict::Format('UI:Error_Details', $e->getHtmlDesc())); $oP->output(); - - if (MetaModel::IsLogEnabledIssue()) - { - if (MetaModel::IsValidClass('EventIssue')) - { + + if (MetaModel::IsLogEnabledIssue()) { + if (MetaModel::IsValidClass('EventIssue')) { $oLog = new EventIssue(); - + $oLog->Set('message', $e->getMessage()); $oLog->Set('userinfo', ''); $oLog->Set('issue', $e->GetIssue()); @@ -433,27 +403,24 @@ catch (CoreException $e) $oLog->Set('data', $e->getContextData()); $oLog->DBInsertNoReload(); } - + IssueLog::Error($e->getMessage()); } - + // For debugging only // throw $e; } -catch (Exception $e) -{ - require_once (APPROOT.'/setup/setuppage.class.inc.php'); +catch (Exception $e) { + require_once(APPROOT.'/setup/setuppage.class.inc.php'); $oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError')); $oP->add("

".Dict::S('UI:FatalErrorMessage')."

\n"); $oP->error(Dict::Format('UI:Error_Details', $e->getMessage())); $oP->output(); - - if (MetaModel::IsLogEnabledIssue()) - { - if (MetaModel::IsValidClass('EventIssue')) - { + + if (MetaModel::IsLogEnabledIssue()) { + if (MetaModel::IsValidClass('EventIssue')) { $oLog = new EventIssue(); - + $oLog->Set('message', $e->getMessage()); $oLog->Set('userinfo', ''); $oLog->Set('issue', 'PHP Exception'); @@ -462,7 +429,7 @@ catch (Exception $e) $oLog->Set('data', array()); $oLog->DBInsertNoReload(); } - + IssueLog::Error($e->getMessage()); } } diff --git a/datamodels/2.x/itop-hub-connector/myextensions.php b/datamodels/2.x/itop-hub-connector/myextensions.php index 6b97fe77e9..daad940096 100644 --- a/datamodels/2.x/itop-hub-connector/myextensions.php +++ b/datamodels/2.x/itop-hub-connector/myextensions.php @@ -17,14 +17,14 @@ * You should have received a copy of the GNU Affero General Public License */ -require_once ('../approot.inc.php'); -require_once (APPROOT.'/application/application.inc.php'); -require_once (APPROOT.'/application/itopwebpage.class.inc.php'); -require_once (APPROOT.'setup/extensionsmap.class.inc.php'); +require_once('../approot.inc.php'); +require_once(APPROOT.'/application/application.inc.php'); +require_once(APPROOT.'/application/itopwebpage.class.inc.php'); +require_once(APPROOT.'setup/extensionsmap.class.inc.php'); -require_once (APPROOT.'/application/startup.inc.php'); +require_once(APPROOT.'/application/startup.inc.php'); -require_once (APPROOT.'/application/loginwebpage.class.inc.php'); +require_once(APPROOT.'/application/loginwebpage.class.inc.php'); LoginWebPage::DoLogin(true); // Check user rights and prompt if needed (must be admin) $oAppContext = new ApplicationContext(); @@ -35,12 +35,9 @@ $oPage->SetBreadCrumbEntry('ui-hub-myextensions', Dict::S('Menu:iTopHub:MyExtens function DisplayExtensionInfo(Webpage $oPage, iTopExtension $oExtension) { $oPage->add('
  • '); - if ($oExtension->sInstalledVersion == '') - { + if ($oExtension->sInstalledVersion == '') { $oPage->add(''.$oExtension->sLabel.' '.Dict::Format('UI:About:Extension_Version', $oExtension->sVersion).' '.Dict::S('iTopHub:ExtensionNotInstalled').''); - } - else - { + } else { $oPage->add(''.$oExtension->sLabel.' '.Dict::Format('UI:About:Extension_Version', $oExtension->sInstalledVersion)); } $oPage->add('

    '.$oExtension->sDescription.'

    '); @@ -48,29 +45,25 @@ function DisplayExtensionInfo(Webpage $oPage, iTopExtension $oExtension) } // Main program -try -{ +try { $oExtensionsMap = new iTopExtensionsMap(); $oExtensionsMap->LoadChoicesFromDatabase(MetaModel::GetConfig()); - + $oPage->add('

    '.Dict::S('iTopHub:InstalledExtensions').'

    '); - + $oPage->add('
    '); $oPage->add(''.Dict::S('iTopHub:ExtensionCategory:Remote').''); $oPage->p(Dict::S('iTopHub:ExtensionCategory:Remote+')); $oPage->add('
      '); $iCount = 0; - foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) - { - if ($oExtension->sSource == iTopExtension::SOURCE_REMOTE) - { - $iCount++ ; + foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) { + if ($oExtension->sSource == iTopExtension::SOURCE_REMOTE) { + $iCount++; DisplayExtensionInfo($oPage, $oExtension); } } $oPage->add('
    '); - if ($iCount == 0) - { + if ($iCount == 0) { $oPage->p(Dict::S('iTopHub:NoExtensionInThisCategory')); } $oPage->add('
    '); @@ -79,45 +72,39 @@ try // Display the section about "manually deployed" extensions, only if there are some already $iCount = 0; - foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) - { - if ($oExtension->sSource == iTopExtension::SOURCE_MANUAL) - { - $iCount++ ; + foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) { + if ($oExtension->sSource == iTopExtension::SOURCE_MANUAL) { + $iCount++; } } - - if ($iCount > 0) - { + + if ($iCount > 0) { $oPage->add('
    '); $oPage->add(''.Dict::S('iTopHub:ExtensionCategory:Manual').''); $oPage->p(Dict::Format('iTopHub:ExtensionCategory:Manual+', '"extensions"')); $oPage->add('
      '); $iCount = 0; - foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) - { - if ($oExtension->sSource == iTopExtension::SOURCE_MANUAL) - { + foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) { + if ($oExtension->sSource == iTopExtension::SOURCE_MANUAL) { DisplayExtensionInfo($oPage, $oExtension); } } $oPage->add('
    '); } - + $oPage->add('
    '); $sExtensionsDirTooltip = json_encode(APPROOT.'extensions'); $oPage->add_style( -<<p(''.Dict::Format('UI:Error_Details', $e->getMessage()).''); }