• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/useragent/detector.php
  • Класс: BitrixMainWebUserAgentDetector
  • Вызов: Detector::getDeviceType
protected function getDeviceType($info)
{
	if ($info->istablet)
	{
		$deviceType = DeviceType::TABLET;
	}
	elseif ($info->ismobiledevice)
	{
		$deviceType = DeviceType::MOBILE_PHONE;
	}
	elseif ($info->device_type == 'TV Device')
	{
		$deviceType = DeviceType::TV;
	}
	elseif ($info->device_type == 'Desktop')
	{
		$deviceType = DeviceType::DESKTOP;
	}
	else
	{
		$deviceType = DeviceType::UNKNOWN;
	}

	return $deviceType;
}