1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
CollabFeature.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace
Bitrix\Socialnetwork\Collab;
7
8
use Bitrix\Bitrix24;
9
use Bitrix\Main\Config\Configuration;
10
use Bitrix\Main\Config\Option;
11
use Bitrix\Main\Loader;
12
use Bitrix\Socialnetwork\Integration\Intranet\Settings;
13
14
class
CollabFeature
15
{
16
public
const
FEATURE_ID
=
'socialnetwork_collab'
;
17
public
const
OPTION_NAME
=
'feature_socialnetwork_collab'
;
18
19
public
static
function
isFeatureEnabled
(): bool
20
{
21
if
(!Loader::includeModule(
'bitrix24'
))
22
{
23
return
true
;
24
}
25
26
return
Bitrix24\Feature::isFeatureEnabled(self::FEATURE_ID);
27
}
28
29
public
static
function
isFeatureEnabledInPortalSettings
(): bool
30
{
31
return
(
new
Settings
())->isToolAvailable(
Settings::SONET_TOOLS
[
'collab'
]);
32
}
33
34
public
static
function
isOn
(): bool
35
{
36
if
(static::isDevMode())
37
{
38
return
true
;
39
}
40
41
return
(
bool
)Option::get(
'socialnetwork'
, self::OPTION_NAME,
true
);
42
}
43
44
public
static
function
turnOn
(): void
45
{
46
Option::set(
'socialnetwork'
, self::OPTION_NAME,
true
);
47
}
48
49
public
static
function
turnOff
(): void
50
{
51
Option::delete(
'socialnetwork'
, [
'name'
=> self::OPTION_NAME]);
52
}
53
54
public
static
function
isDevMode
(): bool
55
{
56
$exceptionHandling = Configuration::getValue(
'exception_handling'
);
57
58
return
!empty($exceptionHandling[
'debug'
]);
59
}
60
}
Bitrix\Socialnetwork\Collab\CollabFeature
Определения
CollabFeature.php:15
Bitrix\Socialnetwork\Collab\CollabFeature\isFeatureEnabled
static isFeatureEnabled()
Определения
CollabFeature.php:19
Bitrix\Socialnetwork\Collab\CollabFeature\isOn
static isOn()
Определения
CollabFeature.php:34
Bitrix\Socialnetwork\Collab\CollabFeature\isFeatureEnabledInPortalSettings
static isFeatureEnabledInPortalSettings()
Определения
CollabFeature.php:29
Bitrix\Socialnetwork\Collab\CollabFeature\turnOn
static turnOn()
Определения
CollabFeature.php:44
Bitrix\Socialnetwork\Collab\CollabFeature\turnOff
static turnOff()
Определения
CollabFeature.php:49
Bitrix\Socialnetwork\Collab\CollabFeature\FEATURE_ID
const FEATURE_ID
Определения
CollabFeature.php:16
Bitrix\Socialnetwork\Collab\CollabFeature\isDevMode
static isDevMode()
Определения
CollabFeature.php:54
Bitrix\Socialnetwork\Collab\CollabFeature\OPTION_NAME
const OPTION_NAME
Определения
CollabFeature.php:17
Bitrix\Socialnetwork\Integration\Intranet\Settings
Определения
settings.php:10
Bitrix\Socialnetwork\Integration\Intranet\Settings\SONET_TOOLS
const SONET_TOOLS
Определения
settings.php:32
bitrix
modules
socialnetwork
lib
Collab
CollabFeature.php
Создано системой
1.14.0