Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
filter.php
1<?php
3
8
9class Filter extends BaseFilter
10{
11 public function __construct(array $options)
12 {
13 parent::__construct();
14 $this->options = $options;
15 }
16
17 public function isAvailable(): bool
18 {
19 return $GLOBALS['USER']->isAuthorized();
20 }
21
22 public function apply(array $items, Dialog $dialog): void
23 {
24 $eventId = (int)$this->getOption('eventId', 0);
25 $isSharing = $this->getOption('isSharingEvent', false);
26 if ($eventId > 0 && $isSharing)
27 {
29 $eventLink = (new Sharing\Link\Factory())->getEventLinkByEventId($eventId);
30 if ($eventLink)
31 {
32 foreach ($items as $item)
33 {
34 if (!($item instanceof Item))
35 {
36 continue;
37 }
38 if ($item->getId() === $eventLink->getOwnerId() || $item->getId() === $eventLink->getHostId())
39 {
40 $item->setDeselectable(false);
41 }
42 }
43 }
44 }
45 }
46}
$GLOBALS['____1444769544']
Definition license.php:1