function add_https_settings($layout_array, $layout_file_path) { // SiteHTTPSURL [Site] // https 1.8.2 if (isset($layout_array['Site'])) { $new_vals = array(); foreach ($layout_array['Site'] as $key => $value) { if (_ml_strcasecmp($key, 'SiteHTTPSURL') != 0) { $new_vals[$key] = $value; } } $layout_array['Site'] = $new_vals; } // HTTPS = YES/NO // https 1.8.2 foreach ($layout_array as $layout_section_name => $vals) { $new_vals = array(); foreach ($vals as $key => $value) { if (_ml_strcasecmp($key, 'HTTPS') != 0) { $new_vals[$key] = $value; } } $layout_array[$layout_section_name] = $new_vals; } // SITE_HTTPS_URL if (isset($layout_array['Site']) && isset($layout_array['Site']['SiteURL'])) { $SiteHTTPSURL = modApiStaticFunc("Configuration", "getCZSiteHTTPSURL", $layout_array['Site']['SiteURL']); if ($SiteHTTPSURL !== NULL) { $layout_array['Site']['SiteHTTPSURL'] = $SiteHTTPSURL; } } // HTTPS $cz_https_settings = modApiStaticFunc("Configuration", "getLayoutSettings"); //Search for current layout path entry $target_layout_file_path = NULL; foreach ($cz_https_settings as $fpath => $info) { if (file_path_cmp($fpath, $layout_file_path) === 0) { $target_layout_file_path = $fpath; break; } } if ($target_layout_file_path !== NULL) { $map = modApiStaticFunc("Configuration", "getLayoutSettingNameByCZLayoutSectionNameMap"); foreach ($map as $layout_section_name => $settings_section_name) { if (isset($layout_array[$layout_section_name])) { $layout_array[$layout_section_name]['HTTPS'] = modApiStaticFunc("Configuration", "getCZHTTPS", $layout_section_name, $cz_https_settings[$target_layout_file_path]); } } } return $layout_array; }
function getLayoutSettings($layout_file_path = NULL) { $result = execQuery('SELECT_LAYOUT_HTTPS_SETTINGS', array()); $array = array(); for ($i = 0; $i < sizeof($result); $i++) { $array[$result[$i]['layout_full_file_name']] = $result[$i]; } if ($layout_file_path == NULL) { return $array; } else { // : //Search for current layout path entry $target_layout_file_path = NULL; foreach ($array as $fpath => $info) { if (file_path_cmp($fpath, $layout_file_path) === 0) { $target_layout_file_path = $fpath; break; } } if ($target_layout_file_path !== NULL) { return $array[$target_layout_file_path]; } else { return NULL; } } }