Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
devicetype.php
1
<?php
2
10
namespace
Bitrix\Main\Web\UserAgent
;
11
12
use
Bitrix\Main\Localization\Loc
;
13
14
class
DeviceType
15
{
16
public
const
UNKNOWN
= 0;
17
public
const
DESKTOP
= 1;
18
public
const
MOBILE_PHONE
= 2;
19
public
const
TABLET
= 3;
20
public
const
TV
= 4;
21
22
public
static
function
getDescription
($lang =
null
): array
23
{
24
static
$description = [];
25
26
if
(!isset($description[$lang ??
''
]))
27
{
28
$description[$lang ??
''
] = [
29
self::UNKNOWN =>
Loc::getMessage
(
'main_devicetype_unknown'
,
null
, $lang),
30
self::DESKTOP =>
Loc::getMessage
(
'main_devicetype_desktop'
,
null
, $lang),
31
self::MOBILE_PHONE =>
Loc::getMessage
(
'main_devicetype_phone'
,
null
, $lang),
32
self::TABLET =>
Loc::getMessage
(
'main_devicetype_tablet'
,
null
, $lang),
33
self::TV =>
Loc::getMessage
(
'main_devicetype_tv'
,
null
, $lang),
34
];
35
}
36
37
return
$description[$lang ??
''
];
38
}
39
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\Web\UserAgent\DeviceType
Definition
devicetype.php:15
Bitrix\Main\Web\UserAgent\DeviceType\MOBILE_PHONE
const MOBILE_PHONE
Definition
devicetype.php:18
Bitrix\Main\Web\UserAgent\DeviceType\DESKTOP
const DESKTOP
Definition
devicetype.php:17
Bitrix\Main\Web\UserAgent\DeviceType\TV
const TV
Definition
devicetype.php:20
Bitrix\Main\Web\UserAgent\DeviceType\TABLET
const TABLET
Definition
devicetype.php:19
Bitrix\Main\Web\UserAgent\DeviceType\UNKNOWN
const UNKNOWN
Definition
devicetype.php:16
Bitrix\Main\Web\UserAgent\DeviceType\getDescription
static getDescription($lang=null)
Definition
devicetype.php:22
Bitrix\Main\Web\UserAgent
Definition
browser.php:10
modules
main
lib
web
useragent
devicetype.php
Создано системой
1.10.0