1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
calendarentity.php
См. документацию.
1<?php
2
3namespace Bitrix\Forum\Comments;
4
5use Bitrix\Main\Config\Option;
6use Bitrix\Main\Loader;
7
8final class CalendarEntity extends Entity
9{
10 public const ENTITY_TYPE = 'ev';
11 const MODULE_ID = 'calendar';
12 public const XML_ID_PREFIX = 'EVENT_';
13
14 protected static $permissions = array();
15
16 private $canRead = null;
21 public function canRead($userId)
22 {
23 if($this->canRead !== null)
24 {
25 return $this->canRead;
26 }
27 $this->canRead = \CCalendarEvent::canView($this->getId(), $userId);
28
29 return $this->canRead;
30 }
31
35 public function canAdd($userId)
36 {
37 return $this->canRead($userId);
38 }
39
44 public function canEditOwn($userId)
45 {
46 return true;
47 }
48
53 public function canEdit($userId)
54 {
55 return false;
56 }
57
64 public static function onMessageIsIndexed($id, array $message, array &$index)
65 {
66 // not index yet because I do not have API from Calendar
67 return false;
68
69 if (!empty($message["PARAM1"]) || !empty($message["PARAM2"]))
70 return false;
71
72 if (
73 preg_match("/".self::getXmlIdPrefix()."(\\d+)(*.?)/", $message["XML_ID"], $matches) &&
74 ($eventId = intval($matches[1])) &&
75 $eventId > 0
76 )
77 {
78 if (!array_key_exists($eventId, self::$permissions))
79 {
80 self::$permissions[$eventId] = array();
81 }
82 $index["PERMISSIONS"] = self::$permissions[$eventId];
83 }
84 return true;
85 }
86}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static onMessageIsIndexed($id, array $message, array &$index)
Определения calendarentity.php:64
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения ufield.php:9
$message
Определения payment.php:8
$matches
Определения index.php:22
$canRead
Определения options.php:9