/* $arResult['FIELDS']['tab_params'][] = array( 'id' => 'C_LANG_'.$arSysLangs[$i], 'value' => '<b>['.$arSysLangs[$i].'] '.$arSysLangNames[$i].'</b>', 'colspan' => true, 'type' => 'label' ); */ $arResult['FIELDS']['tab_params'][] = array('id' => 'COUNTRY_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arCountry["NAME"]), 'required' => true, 'type' => 'text'); $arResult['FIELDS']['tab_params'][] = array('id' => 'COUNTRY_SHORT_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arCountry["SHORT_NAME"]), 'type' => 'text'); } /* REGION SECTION */ $arResult['FIELDS']['tab_params'][] = array('id' => 'loc_region', 'name' => GetMessage('CRM_LOC_SECTION_REGION'), 'type' => 'section'); $arRegionList[CRM_LOC_NEW_REGION] = '< ' . GetMessage('CRM_LOC_NEW_REGION') . ' >'; $arRegionList[CRM_LOC_WITHOUT_REGION] = '< ' . GetMessage('CRM_LOC_WITHOUT_REGION') . ' >'; $arRegionArr = CCrmLocations::getRegionsNames($arLoc['COUNTRY_ID']); foreach ($arRegionArr as $regionID => $region) { $arRegionList[$regionID] = $region; } $arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_ID', 'name' => GetMessage('CRM_LOC_FIELD_REGION_ID'), 'value' => intval($arLoc['REGION_ID']) > 0 ? $arLoc['REGION_ID'] : '', 'type' => 'list', 'required' => true, 'items' => $arRegionList); $arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_NAME', 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arLoc['REGION_NAME_ORIG']), 'required' => true, 'type' => 'text'); $arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_SHORT_NAME', 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arLoc['REGION_SHORT_NAME']), 'type' => 'text'); for ($i = 0; $i < $countLang; $i++) { $arRegion = CSaleLocation::GetRegionLangByID($arLoc['REGION_ID'], $arSysLangs[$i]); /* $arResult['FIELDS']['tab_params'][] = array( 'id' => 'R_LANG_'.$arSysLangs[$i], 'value' => '<b>['.$arSysLangs[$i].'] '.$arSysLangNames[$i].'</b>', 'colspan' => true, 'type' => 'label' );
if ($ID <= 0) { break; } $arCountry = CSaleLocation::GetCountryByID($ID); $arCountry['COUNTRY_NAME'] = $arCountry['NAME']; $arCountry['COUNTRY_SHORT_NAME'] = $arCountry['SHORT_NAME']; unset($arCountry['NAME']); unset($arCountry['SHORT_NAME']); $countLang = count($arSysLangs); for ($i = 0; $i < $countLang; $i++) { $arLngCountry = CSaleLocation::GetCountryLangByID($ID, $arSysLangs[$i]); $arCountry['COUNTRY_NAME_' . $arSysLangs[$i]] = $arLngCountry['NAME']; $arCountry['COUNTRY_SHORT_NAME_' . $arSysLangs[$i]] = $arLngCountry['SHORT_NAME_']; } $arReturn['COUNTRY'] = $arCountry; $arRegions = CCrmLocations::getRegionsNames($ID); $arReturn['COUNTRY']['REGIONS'] = array(); foreach ($arRegions as $id => $region) { $arReturn['COUNTRY']['REGIONS'][] = array($id, $region); } break; case 'get_region_params': $arRegion = CSaleLocation::GetRegionByID($ID); $arRegion['REGION_NAME'] = $arRegion['NAME']; $arRegion['REGION_SHORT_NAME'] = $arRegion['SHORT_NAME']; unset($arRegion['NAME']); unset($arRegion['SHORT_NAME']); $countLang = count($arSysLangs); for ($i = 0; $i < $countLang; $i++) { $arLngCountry = CSaleLocation::GetRegionLangByID($ID, $arSysLangs[$i]); $arRegion['REGION_NAME_' . $arSysLangs[$i]] = $arLngCountry['NAME'];