Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
event.php
1
<?php
2
3
namespace
Bitrix\Calendar\Ui\Preview
;
4
5
use
Bitrix\Main\Loader
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
Loc::loadLanguageFile
(__FILE__);
9
10
class
Event
11
{
12
public
static
function
buildPreview
(array $params)
13
{
14
global $APPLICATION;
15
$eventId = (int)$params[
'eventId'
];
16
if
(!$eventId)
17
{
18
return
''
;
19
}
20
21
ob_start();
22
$APPLICATION->IncludeComponent(
23
'bitrix:calendar.event.preview'
,
24
''
,
25
$params
26
);
27
return
ob_get_clean();
28
}
29
30
public
static
function
checkUserReadAccess
(array $params): bool
31
{
32
$eventId = (int)$params[
'eventId'
];
33
if
(
34
!$eventId
35
|| !Loader::includeModule(
'calendar'
)
36
)
37
{
38
return
false
;
39
}
40
41
$events = \CCalendarEvent::getList(
42
[
43
'arFilter'
=> [
44
'ID'
=> $eventId,
45
'DELETED'
=>
false
,
46
],
47
'parseRecursion'
=>
false
,
48
'fetchAttendees'
=>
true
,
49
'checkPermissions'
=>
true
,
50
'setDefaultLimit'
=>
false
51
]
52
);
53
54
return
($events && is_array($events[0]));
55
}
56
57
public
static
function
getImAttach
(array $params)
58
{
59
return
false
;
60
}
61
62
public
static
function
getImRich
(array $params)
63
{
64
if
(!Loader::includeModule(
'im'
))
65
{
66
return
false
;
67
}
68
69
if
(!class_exists(
'\Bitrix\Im\V2\Entity\Url\RichData'
))
70
{
71
return
false
;
72
}
73
74
return
(
new
\
Bitrix
\Im\V2\
Entity
\Url\RichData())->setType(\
Bitrix
\Im\V2\
Entity
\Url\RichData::CALENDAR_TYPE);
75
}
76
77
protected
static
function
getUser
()
78
{
79
global $USER;
80
81
return
$USER;
82
}
83
}
Bitrix\Calendar\Ui\Preview\Event
Definition
event.php:11
Bitrix\Calendar\Ui\Preview\Event\checkUserReadAccess
static checkUserReadAccess(array $params)
Definition
event.php:30
Bitrix\Calendar\Ui\Preview\Event\buildPreview
static buildPreview(array $params)
Definition
event.php:12
Bitrix\Calendar\Ui\Preview\Event\getImRich
static getImRich(array $params)
Definition
event.php:62
Bitrix\Calendar\Ui\Preview\Event\getImAttach
static getImAttach(array $params)
Definition
event.php:57
Bitrix\Calendar\Ui\Preview\Event\getUser
static getUser()
Definition
event.php:77
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadLanguageFile
static loadLanguageFile($file, $language=null, $normalize=true)
Definition
loc.php:224
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Calendar\Ui\Preview
Definition
event.php:3
Bitrix
modules
calendar
lib
ui
preview
event.php
Создано системой
1.10.0