Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
requestpopup.php
1<?php
2
10
18use Bitrix\Socialnetwork\Integration;
19
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}