• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::mobileConfigGet
static function mobileConfigGet($params, $n, CRestServer $server)
{
	if (
		$server->getAuthType() != BitrixRestSessionAuthAuth::AUTH_TYPE
		&& !self::isDebugEnabled()
	)
	{
		throw new BitrixRestRestException("Get access to browser const available only for session authorization.", "WRONG_AUTH_TYPE", CRestServer::STATUS_FORBIDDEN);

	}

	$config = Array();

	$settings = CIMSettings::Get();
	$config['SETTINGS'] = $settings['settings'];

	$userId = $GLOBALS['USER']->GetID();
	if (!isset($config['CONTACT_LIST']['users'][$userId]))
	{
		$arUsers = CIMContactList::GetUserData(array(
												   'ID' => $userId,
												   'DEPARTMENT' => 'N',
												   'USE_CACHE' => 'Y',
												   'SHOW_ONLINE' => 'N'
											   ));
		$config['CONTACT_LIST']['users'][$userId] = $arUsers['users'][$userId];
	}

	$config["ACTION"] = 'DIALOG';
	$config["PATH_TO_USER_PROFILE"] = SITE_DIR.'mobile/users/?user_id='.$userId.'&FROM_DIALOG=Y';
	$config["PATH_TO_USER_PROFILE_TEMPLATE"] = SITE_DIR.'mobile/users/?user_id=#user_id#&FROM_DIALOG=Y';

	$config['WEBRTC_MOBILE_SUPPORT'] = BitrixMainLoader::includeModule('mobileapp')? BitrixMobileAppMobile::getInstance()->isWebRtcSupported(): false;

	return CIMMessenger::GetMobileDialogTemplateJS([], $config);
}