= 'W' && Loader::includeModule($module_id)): /** * @global CUser $USER * @global CMain $APPLICATION **/ IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/modules/main/options.php'); IncludeModuleLangFile(__FILE__); $aTabs = array( array('DIV' => 'edit1', 'TAB' => Loc::getMessage('LOCATION_OPT_TAB_OPTIONS'), 'ICON' => "", 'TITLE' => Loc::getMessage('LOCATION_OPT_TAB_OPTIONS')), array('DIV' => 'edit2', 'TAB' => Loc::getMessage('LOCATION_OPT_TAB_SOURCES_OPTIONS'), 'ICON' => "", 'TITLE' => Loc::getMessage('LOCATION_OPT_TAB_SOURCES_OPTIONS')), array('DIV' => 'edit3', 'TAB' => Loc::getMessage('MAIN_TAB_RIGHTS'), 'ICON' => "", 'TITLE' => Loc::getMessage('MAIN_TAB_TITLE_RIGHTS')), ); $tabControl = new CAdminTabControl('tabControl', $aTabs); $sourceRepository = new SourceRepository(new OrmConverter()); $sources = $sourceRepository->findAll(); if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_REQUEST['Update'] !== "" && check_bitrix_sessid()) { /** * Common settings */ if(isset($_REQUEST['address_format_code'])) { Bitrix\Location\Infrastructure\FormatCode::setCurrent($_REQUEST['address_format_code']); } if(isset($_REQUEST['log_level'])) { Option::set('location', 'log_level', (string)$_REQUEST['log_level']); } /** * Sources */ foreach ($sources as $source) { $sourceCode = $source->getCode(); $sourceConfig = $source->getConfig() ?? new Config(); if (!isset($_REQUEST['SOURCE'][$sourceCode])) { continue; } $sourceRequest = $_REQUEST['SOURCE'][$sourceCode]; /** * Update source config */ $sourceConfigRequest = $_REQUEST['SOURCE'][$sourceCode]['CONFIG'] ?? []; /** @var ConfigItem $configItem */ foreach ($sourceConfig as $configItem) { if (!$configItem->isVisible()) { continue; } if (!isset($sourceConfigRequest[$configItem->getCode()])) { continue; } $value = null; if ($configItem->getType() === ConfigItem::STRING_TYPE) { $value = $sourceConfigRequest[$configItem->getCode()]; } elseif ($configItem->getType() === ConfigItem::BOOL_TYPE) { $value = $sourceConfigRequest[$configItem->getCode()] === 'Y'; } $configItem->setValue($value); } $source->setConfig($sourceConfig); /** * Save updated source to database */ $sourceRepository->save($source); } ob_start(); require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/admin/group_rights.php'); ob_end_clean(); if($_REQUEST['back_url_settings'] <> '') LocalRedirect($_REQUEST['back_url_settings']); LocalRedirect($APPLICATION->GetCurPage().'?mid='.urlencode($module_id).'&lang='.urlencode(LANGUAGE_ID).'&'.$tabControl->ActiveTabParam()); } $formatCode = Bitrix\Location\Infrastructure\FormatCode::getCurrent(); $formatList = []; $formatDescriptionList = []; $formatDescription = ''; foreach(FormatService::getInstance()->findAll(LANGUAGE_ID) as $format) { $formatList[$format->getCode()] = $format->getName(); $formatDescriptionList[$format->getCode()] = $format->getDescription(); if($format->getCode() === $formatCode) { $formatDescription = $format->getDescription(); } } $currentLogLevel = (int)Option::get('location', 'log_level', LogLevel::ERROR); $logLevels = [ LogLevel::NONE => loc::getMessage('LOCATION_OPT_LOG_LEVEL_NONE'), LogLevel::ERROR => loc::getMessage('LOCATION_OPT_LOG_LEVEL_ERROR'), LogLevel::INFO => loc::getMessage('LOCATION_OPT_LOG_LEVEL_INFO'), LogLevel::DEBUG => loc::getMessage('LOCATION_OPT_LOG_LEVEL_DEBUG') ]; $tabControl->Begin(); ?>
BeginNextTab();?> :
: BeginNextTab();?> getCode(); if ( $sourceCode === \Bitrix\Location\Entity\Source\Factory::OSM_SOURCE_CODE && !\Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24') ) { continue; } $config = $source->getConfig(); ?> getName())?> isVisible()) { continue; } $code = $configItem->getCode(); $inputName = sprintf( 'SOURCE[%s][CONFIG][%s]', $sourceCode, $code ); $name = Loc::getMessage( sprintf( 'LOCATION_OPT_SOURCE_%s_%s', $sourceCode, $code ) ); $note = Loc::getMessage( sprintf( 'LOCATION_OPT_SOURCE_%s_%s_NOTE', $sourceCode, $code ) ); ?> : getType() == ConfigItem::STRING_TYPE):?> getType() == ConfigItem::BOOL_TYPE):?> getValue() ? ' checked' : '')?> > BeginNextTab();?> Buttons();?> " title="" class="adm-btn-save"> ''):?> " onclick="window.location="''> "> End();?>