Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sharingfeature.php
1
<?php
2
3
namespace
Bitrix\Calendar\Sharing
;
4
5
use
Bitrix\Main\Result
;
6
use
Bitrix\Main\Config\Option
;
7
use
Bitrix\Main\Loader
;
8
use Bitrix\CalendarMobile;
9
10
class
SharingFeature
11
{
12
private
const
SHARING_OPTION_NAME =
'isSharingEnabled'
;
13
private
const
OPTION_ENABLED =
'Y'
;
14
private
const
OPTION_DISABLED =
'N'
;
15
20
public
static
function
enable
():
Result
21
{
22
$result =
new
Result
();
23
Option::set(
'calendar'
, self::SHARING_OPTION_NAME, self::OPTION_ENABLED);
24
if
(Loader::includeModule(
'calendarmobile'
))
25
{
26
$r = CalendarMobile\JSComponent::enable();
27
$result->addErrors($r->getErrors());
28
}
29
30
return
$result;
31
}
32
37
public
static
function
disable
():
Result
38
{
39
$result =
new
Result
();
40
Option::set(
'calendar'
, self::SHARING_OPTION_NAME, self::OPTION_DISABLED);
41
if
(Loader::includeModule(
'calendarmobile'
))
42
{
43
$r = CalendarMobile\JSComponent::disable();
44
$result->addErrors($r->getErrors());
45
}
46
47
return
$result;
48
}
49
54
public
static
function
isEnabled
(): bool
55
{
56
return
true
;
57
}
58
}
Bitrix\Calendar\Core\Base\Result
Definition
result.php:6
Bitrix\Calendar\Sharing\SharingFeature
Definition
sharingfeature.php:11
Bitrix\Calendar\Sharing\SharingFeature\enable
static enable()
Definition
sharingfeature.php:20
Bitrix\Calendar\Sharing\SharingFeature\disable
static disable()
Definition
sharingfeature.php:37
Bitrix\Calendar\Sharing\SharingFeature\isEnabled
static isEnabled()
Definition
sharingfeature.php:54
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Calendar\Sharing
Definition
analytics.php:3
modules
calendar
lib
sharing
sharingfeature.php
Создано системой
1.10.0