Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
requestpopup.php
1
<?php
2
9
namespace
Bitrix\Socialnetwork\Helper\UserToGroup
;
10
11
use
Bitrix\Main\Application
;
12
use
Bitrix\Main\Config\Option
;
13
use
Bitrix\Main\Loader
;
14
use
Bitrix\Main\Localization\Loc
;
15
use
Bitrix\Main\ModuleManager
;
16
use
Bitrix\Socialnetwork\WorkgroupTable
;
17
use
Bitrix\Socialnetwork\UserToGroupTable
;
18
use Bitrix\Socialnetwork\Integration;
19
20
class
RequestPopup
21
{
22
public
static
function
setHideRequestPopup
(array $params = []): bool
23
{
24
$userId = (int)($params[
'userId'
] ?? 0);
25
$groupId = (int)($params[
'groupId'
] ?? 0);
26
27
if
($userId <= 0 || $groupId <= 0)
28
{
29
return
false
;
30
}
31
32
\CUserOptions::setOption(
33
'socialnetwork'
,
34
'hide_request_popup_'
. $groupId,
35
'Y'
,
36
false
,
37
$userId,
38
);
39
40
return
true
;
41
}
42
43
public
static
function
unsetHideRequestPopup
(array $params = []): bool
44
{
45
$userId = (int)($params[
'userId'
] ?? 0);
46
$groupId = (int)($params[
'groupId'
] ?? 0);
47
48
if
($userId <= 0 || $groupId <= 0)
49
{
50
return
false
;
51
}
52
53
\CUserOptions::deleteOption(
54
'socialnetwork'
,
55
'hide_request_popup_'
. $groupId,
56
false
,
57
$userId,
58
);
59
60
return
true
;
61
}
62
63
public
static
function
checkHideRequestPopup
(array $params = []): bool
64
{
65
$userId = (int)($params[
'userId'
] ?? 0);
66
$groupId = (int)($params[
'groupId'
] ?? 0);
67
68
if
($userId <= 0 || $groupId <= 0)
69
{
70
return
false
;
71
}
72
73
return
(\CUserOptions::getOption(
'socialnetwork'
,
'hide_request_popup_'
. $groupId) ===
'Y'
);
74
}
75
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\ModuleManager
Definition
modulemanager.php:5
Bitrix\Socialnetwork\Helper\UserToGroup\RequestPopup
Definition
requestpopup.php:21
Bitrix\Socialnetwork\Helper\UserToGroup\RequestPopup\unsetHideRequestPopup
static unsetHideRequestPopup(array $params=[])
Definition
requestpopup.php:43
Bitrix\Socialnetwork\Helper\UserToGroup\RequestPopup\checkHideRequestPopup
static checkHideRequestPopup(array $params=[])
Definition
requestpopup.php:63
Bitrix\Socialnetwork\Helper\UserToGroup\RequestPopup\setHideRequestPopup
static setHideRequestPopup(array $params=[])
Definition
requestpopup.php:22
Bitrix\Socialnetwork\UserToGroupTable
Definition
usertogroup.php:33
Bitrix\Socialnetwork\WorkgroupTable
Definition
workgroup.php:33
Bitrix\Socialnetwork\Helper\UserToGroup
Definition
requestpopup.php:9
modules
socialnetwork
lib
helper
usertogroup
requestpopup.php
Создано системой
1.10.0