• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/subtype/map.php
  • Класс: BitrixLandingSubtypeMap
  • Вызов: Map::addRequiredUserAction
static function addRequiredUserAction(array $manifest): array
{
	$isGoogleFail =
		self::$provider === self::PROVIDER_GOOGLE
		&& (!self::$settings['GMAP']['USE'] || empty(self::$settings['GMAP']['CODE']));
	$isYandexFail =
		self::$provider === self::PROVIDER_YANDEX
		&& (!self::$settings['YMAP']['USE'] || empty(self::$settings['YMAP']['CODE']));

	$error = '';
	$description = '';

	if ($isYandexFail && self::canUseYandex())
		{
			$error = Loc::getMessage('LANDING_BLOCK_EMPTY_YMAP_TITLE');
			$description = Loc::getMessage('LANDING_BLOCK_EMPTY_YMAP_DESC');
		}
	elseif ($isGoogleFail)
	{
		$error = Loc::getMessage('LANDING_BLOCK_EMPTY_GMAP_TITLE');
		$description = Loc::getMessage('LANDING_BLOCK_EMPTY_GMAP_DESC');
	}

	if ($error && !is_array($manifest['requiredUserAction']))
	{
		$manifest['requiredUserAction'] = [
			'header' => $error,
			'description' => $description,
			'text' => Loc::getMessage('LANDING_BLOCK_EMPTY_GMAP_SETTINGS'),
			'href' => '#page_url_site_edit@map_required_key',
			'className' => 'landing-required-link',
			'targetNodeSelector' => self::MAP_SELECTOR,
		];
	}

	return $manifest;
}