Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
settings.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Activity
;
4
5
use
Bitrix\Main\Text\Emoji
;
6
7
class
Settings
8
{
9
private
string
$category;
10
11
public
function
__construct
(
string
$category)
12
{
13
$this->category = $category;
14
}
15
19
public
function
get
()
20
{
21
$settings = \CUserOptions::GetOption($this->category,
'activity_settings'
);
22
if
(is_array($settings) || is_string($settings))
23
{
24
static::decodeSettings($settings);
25
}
26
else
27
{
28
$settings =
null
;
29
}
30
31
return
$settings;
32
}
33
38
public
function
save
($settings): void
39
{
40
static::encodeSettings($settings);
41
\CUserOptions::SetOption($this->category,
'activity_settings'
, $settings);
42
}
43
48
public
static
function
decodeSettings
(&$settings): void
49
{
50
if
(is_array($settings))
51
{
52
array_walk_recursive(
53
$settings,
54
function
(&$value) {
55
if
(is_string($value))
56
{
57
$value =
Emoji::decode
($value);
58
}
59
}
60
);
61
}
62
elseif (is_string($settings))
63
{
64
Emoji::decode
($settings);
65
}
66
}
67
72
public
static
function
encodeSettings
(&$settings): void
73
{
74
if
(is_array($settings))
75
{
76
array_walk_recursive(
77
$settings,
78
function
(&$value) {
79
if
(is_string($value))
80
{
81
$value =
Emoji::encode
($value);
82
}
83
}
84
);
85
}
86
elseif (is_string($settings))
87
{
88
$settings =
Emoji::encode
($settings);
89
}
90
}
91
}
Bitrix\Bizproc\Activity\Settings
Definition
settings.php:8
Bitrix\Bizproc\Activity\Settings\save
save($settings)
Definition
settings.php:38
Bitrix\Bizproc\Activity\Settings\encodeSettings
static encodeSettings(&$settings)
Definition
settings.php:72
Bitrix\Bizproc\Activity\Settings\__construct
__construct(string $category)
Definition
settings.php:11
Bitrix\Bizproc\Activity\Settings\decodeSettings
static decodeSettings(&$settings)
Definition
settings.php:48
Bitrix\Main\Text\Emoji
Definition
emoji.php:10
Bitrix\Main\Text\Emoji\encode
static encode($text)
Definition
emoji.php:17
Bitrix\Main\Text\Emoji\decode
static decode($text)
Definition
emoji.php:24
Bitrix\Bizproc\Activity
Definition
baseactivity.php:3
modules
bizproc
lib
activity
settings.php
Создано системой
1.10.0