1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
pushsmartfilter.php
См. документацию.
1
<?php
2
namespace
Bitrix\Pull;
3
4
use Bitrix\Main\Config\Option;
5
6
class
PushSmartfilter
7
{
8
public
static
function
getStatus
(
$userId
=
null
)
9
{
10
if
(!\CPullOptions::GetPushStatus())
11
{
12
return
null
;
13
}
14
15
if
(is_null(
$userId
) && is_object(
$GLOBALS
[
'USER'
]))
16
{
17
$userId
=
$GLOBALS
[
'USER'
]->getId();
18
}
19
$userId
= intval(
$userId
);
20
if
(!
$userId
)
21
{
22
return
false
;
23
}
24
25
$isSmartFilterDisabledByDefault = Option::get(
'pull'
,
'is_smartfilter_disabled_by_default'
,
'N'
) ===
'Y'
;
26
if
($isSmartFilterDisabledByDefault)
27
{
28
return
(
bool
)\CUserOptions::GetOption(
'pull'
,
'push_smartfilter_status_v2'
,
false
,
$userId
);
29
}
30
31
return
(
bool
)\CUserOptions::GetOption(
'pull'
,
'push_smartfilter_status'
,
true
,
$userId
);
32
}
33
34
public
static
function
setStatus
(
$status
,
$userId
=
null
)
35
{
36
if
(!\CPullOptions::GetPushStatus())
37
{
38
return
null
;
39
}
40
41
if
(is_null(
$userId
) && is_object(
$GLOBALS
[
'USER'
]))
42
{
43
$userId
=
$GLOBALS
[
'USER'
]->getId();
44
}
45
$userId
= intval(
$userId
);
46
if
(!
$userId
)
47
{
48
return
false
;
49
}
50
51
$status
=
$status
===
false
?
false
:
true
;
52
53
$isSmartFilterDisabledByDefault = Option::get(
'pull'
,
'is_smartfilter_disabled_by_default'
,
'N'
) ===
'Y'
;
54
if
($isSmartFilterDisabledByDefault)
55
{
56
return
(
bool
)\CUserOptions::SetOption(
'pull'
,
'push_smartfilter_status_v2'
,
$status
,
false
,
$userId
);
57
}
58
59
return
(
bool
)\CUserOptions::SetOption(
'pull'
,
'push_smartfilter_status'
,
$status
,
false
,
$userId
);
60
}
61
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Pull\PushSmartfilter
Определения
pushsmartfilter.php:7
Bitrix\Pull\PushSmartfilter\getStatus
static getStatus($userId=null)
Определения
pushsmartfilter.php:8
Bitrix\Pull\PushSmartfilter\setStatus
static setStatus($status, $userId=null)
Определения
pushsmartfilter.php:34
$status
$status
Определения
session.php:10
Bitrix\Main\$GLOBALS
$GLOBALS['____1690880296']
Определения
license.php:1
bitrix
modules
pull
lib
pushsmartfilter.php
Создано системой
1.14.0