Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
SpaceListMode.php
1
<?php
2
namespace
Bitrix\Socialnetwork\Space\List
;
3
4
final
class
SpaceListMode
5
{
6
private
const
MODULE_NAME =
'socialnetwork'
;
7
private
const
OPTION_NAME =
'spacesListState'
;
8
private
const
DEFAULT_VALUE =
Dictionary::SPACE_LIST_STATES
[
'default'
];
9
10
public
static
function
getOption
(): string
11
{
12
$spacesListMode = \CUserOptions::GetOption(
13
self::MODULE_NAME,
14
self::OPTION_NAME,
15
self::DEFAULT_VALUE,
16
);
17
18
if
(!in_array($spacesListMode,
Dictionary::SPACE_LIST_STATES
,
true
))
19
{
20
$spacesListMode = self::DEFAULT_VALUE;
21
}
22
23
return
$spacesListMode;
24
}
25
26
public
static
function
setOption
(
int
$userId,
string
$mode): void
27
{
28
if
(in_array($mode,
Dictionary::SPACE_LIST_STATES
))
29
{
30
\CUserOptions::SetOption(
31
self::MODULE_NAME,
32
self::OPTION_NAME,
33
$mode,
34
false
,
35
$userId,
36
);
37
}
38
}
39
}
Bitrix\Socialnetwork\Space\List\Dictionary\SPACE_LIST_STATES
const SPACE_LIST_STATES
Definition
Dictionary.php:40
Bitrix\Socialnetwork\Space\List\SpaceListMode
Definition
SpaceListMode.php:5
Bitrix\Socialnetwork\Space\List\SpaceListMode\getOption
static getOption()
Definition
SpaceListMode.php:10
Bitrix\Socialnetwork\Space\List\SpaceListMode\setOption
static setOption(int $userId, string $mode)
Definition
SpaceListMode.php:26
Bitrix\Socialnetwork\Space\List
Definition
Dictionary.php:3
modules
socialnetwork
lib
Space
List
SpaceListMode.php
Создано системой
1.10.0