Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sharingfeature.php
1<?php
2
4
8use Bitrix\CalendarMobile;
9
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}