Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
signaturehelper.php
1
<?php
2
namespace
Bitrix\Main\UserField
;
3
4
class
SignatureHelper
5
{
6
public
static
function
getSignature
(
SignatureManager
$signatureManager, array $fieldParam)
7
{
8
return
$signatureManager->
getSignature
(
9
static::getSignatureParam($fieldParam)
10
);
11
}
12
13
public
static
function
validateSignature
(
SignatureManager
$signatureManager, array $fieldParam, $signature)
14
{
15
return
$signatureManager->
validateSignature
(
16
static::getSignatureParam($fieldParam),
17
$signature
18
);
19
}
20
21
protected
static
function
getSignatureParam
(array $fieldParam)
22
{
23
array_walk_recursive($fieldParam,
function
(&$item)
24
{
25
$item = strval($item);
26
});
27
28
$signatureParam = array(
29
'ENTITY_ID'
=> $fieldParam[
'ENTITY_ID'
],
30
'FIELD'
=> $fieldParam[
'FIELD'
],
31
);
32
33
if
(!empty($fieldParam[
'VALUE'
]))
34
{
35
$fieldParam[
'VALUE'
] = str_replace(
"\r\n"
,
"\n"
, $fieldParam[
'VALUE'
]);
36
$signatureParam[
'VALUE'
] = $fieldParam[
'VALUE'
];
37
}
38
39
if
(!empty($fieldParam[
'CONTEXT'
]))
40
{
41
$signatureParam[
'CONTEXT'
] = $fieldParam[
'CONTEXT'
];
42
}
43
44
return
serialize($signatureParam);
45
}
46
}
Bitrix\Main\UserField\SignatureHelper
Definition
signaturehelper.php:5
Bitrix\Main\UserField\SignatureHelper\validateSignature
static validateSignature(SignatureManager $signatureManager, array $fieldParam, $signature)
Definition
signaturehelper.php:13
Bitrix\Main\UserField\SignatureHelper\getSignature
static getSignature(SignatureManager $signatureManager, array $fieldParam)
Definition
signaturehelper.php:6
Bitrix\Main\UserField\SignatureHelper\getSignatureParam
static getSignatureParam(array $fieldParam)
Definition
signaturehelper.php:21
Bitrix\Main\UserField\SignatureManager
Definition
signaturemanager.php:8
Bitrix\Main\UserField\SignatureManager\validateSignature
validateSignature($data, $signature)
Definition
signaturemanager.php:23
Bitrix\Main\UserField\SignatureManager\getSignature
getSignature($data)
Definition
signaturemanager.php:18
Bitrix\Main\UserField
modules
main
lib
userfield
signaturehelper.php
Создано системой
1.10.0