1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
consentinstaller.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sender\Preset\Consent
;
4
5
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Main\UserConsent\Agreement
;
8
use
Bitrix\Main\UserConsent\Internals\AgreementTable
;
9
Loc::loadMessages(__FILE__);
10
11
class
ConsentInstaller
12
{
13
public
static
function
run
(
string
$lang
): string
14
{
15
self::createConsent(
'sender_approve_confirmation_'
,
$lang
);
16
17
return
''
;
18
}
19
20
private
static
function
createConsent(
string
$code
,
string
$lang
)
21
{
22
$preparedCode =
$code
.$lang;
23
$existed = AgreementTable::getList(
array
(
24
'select'
=> [
'ID'
],
25
'filter'
=> [
26
'=CODE'
=> $preparedCode,
27
'=LANGUAGE_ID'
=>
$lang
,
28
],
29
'limit'
=> 1
30
));
31
32
33
if
($existed->fetch())
34
{
35
return
''
;
36
}
37
38
$title
= Loc::getMessage(
$code
.
'title'
,
null
,
$lang
);
39
if
(!
$title
)
40
{
41
return
'\\Bitrix\\Sender\\Preset\\Consent\\ConsentInstaller::run(\''
.$lang.
'\'
)
';
42
}
43
44
AgreementTable::add(array(
45
"CODE" => $preparedCode,
46
"NAME" => $title,
47
"TYPE" => Agreement::TYPE_CUSTOM,
48
"LANGUAGE_ID" => $lang,
49
"AGREEMENT_TEXT" => Loc::getMessage($code . '
text
',null, $lang),
50
"LABEL_TEXT" => Loc::getMessage($code . '
label
', null, $lang),
51
));
52
}
53
}
Bitrix\Main\Localization\Loc
Определения
loc.php:12
Bitrix\Main\UserConsent\Agreement
Определения
agreement.php:25
Bitrix\Main\UserConsent\Internals\AgreementTable
Определения
agreement.php:38
Bitrix\Sender\Preset\Consent\ConsentInstaller
Определения
consentinstaller.php:12
Bitrix\Sender\Preset\Consent\ConsentInstaller\run
static run(string $lang)
Определения
consentinstaller.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
$lang
if(!defined('SITE_ID')) $lang
Определения
include.php:91
Bitrix\Sender\Preset\Consent
Определения
consentinstaller.php:3
$title
$title
Определения
pdf.php:123
bitrix
modules
sender
lib
preset
consent
consentinstaller.php
Создано системой
1.14.0