Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
cookies.php
1
<?php
2
namespace
Bitrix\Landing\Controller
;
3
4
use \Bitrix\Main\Engine\Controller;
5
6
class
Cookies
extends
Controller
7
{
8
public
function
getDefaultPreFilters
()
9
{
10
return
[];
11
}
12
18
public
function
getAgreementsAction
(
int
$siteId): array
19
{
20
$mainAgreement = \Bitrix\Landing\Site\Cookies::getMainAgreement(
21
\
Bitrix
\
Landing
\
Hook
\
Page
\
Cookies::getAgreementIdBySiteId
($siteId)
22
);
23
$agreements = \Bitrix\Landing\Site\Cookies::getAgreements($siteId,
true
);
24
25
$data = [
26
'main'
=> $mainAgreement,
27
'analytic'
=> array_filter($agreements,
function
($item)
28
{
29
return
$item[
'ACTIVE'
] ==
'Y'
&& $item[
'TYPE'
] ==
'analytic'
;
30
}),
31
'technical'
=> array_filter($agreements,
function
($item)
32
{
33
return
$item[
'ACTIVE'
] ==
'Y'
&& $item[
'TYPE'
] ==
'technical'
;
34
}),
35
'other'
=> array_filter($agreements,
function
($item)
36
{
37
return
$item[
'ACTIVE'
] ==
'Y'
&& $item[
'TYPE'
] ==
'other'
;
38
})
39
];
40
41
foreach
($data as $key => $val)
42
{
43
if
(!$val)
44
{
45
unset($data[$key]);
46
}
47
}
48
49
return
$data;
50
}
51
58
public
function
acceptAgreementsAction
(
int
$siteId, array $accepted = []): void
59
{
60
\Bitrix\Landing\Site\Cookies::acceptAgreement($siteId, $accepted);
61
}
62
}
Bitrix\Landing\Connector\Landing
Definition
landing.php:12
Bitrix\Landing\Controller\Cookies
Definition
cookies.php:7
Bitrix\Landing\Controller\Cookies\acceptAgreementsAction
acceptAgreementsAction(int $siteId, array $accepted=[])
Definition
cookies.php:58
Bitrix\Landing\Controller\Cookies\getDefaultPreFilters
getDefaultPreFilters()
Definition
cookies.php:8
Bitrix\Landing\Controller\Cookies\getAgreementsAction
getAgreementsAction(int $siteId)
Definition
cookies.php:18
Bitrix\Landing\Hook\Page\Cookies\getAgreementIdBySiteId
static getAgreementIdBySiteId(int $siteId)
Definition
cookies.php:209
Bitrix\Landing\Hook\Page
Definition
page.php:7
Bitrix\Landing\Hook
Definition
hook.php:10
Bitrix\Landing\Controller
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
Bitrix
modules
landing
lib
controller
cookies.php
Создано системой
1.10.0