Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
event.php
1<?php
2
4
7
9
10class 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}
static checkUserReadAccess(array $params)
Definition event.php:30
static buildPreview(array $params)
Definition event.php:12
static getImRich(array $params)
Definition event.php:62
static getImAttach(array $params)
Definition event.php:57
static loadLanguageFile($file, $language=null, $normalize=true)
Definition loc.php:224