1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
roomprovider.php
См. документацию.
1<?php
2namespace Bitrix\Calendar\Integration\UI\EntitySelector;
3use Bitrix\UI\EntitySelector\Dialog;
4use Bitrix\UI\EntitySelector\Item;
5
7{
8 public const ENTITY_ID = 'room';
9
10 public function __construct(array $options = [])
11 {
12 parent::__construct();
14 }
15
16 protected function prepareOptions(array $options = [])
17 {
18
19 }
20
21 public function isAvailable(): bool
22 {
23 return $GLOBALS['USER']->isAuthorized();
24 }
25
26 public function shouldFillDialog(): bool
27 {
28 return $this->getOption('fillDialog', true);
29 }
30
31 public function getItems(array $ids): array
32 {
34
35 return $this->getItemsFromRoomList($roomList);
36 }
37
38 public function getSelectedItems(array $ids): array
39 {
41
42 return $this->getItemsFromRoomList($roomList);
43 }
44
45 public function getItemsFromRoomList(array $roomList)
46 {
47 $items = [];
48 foreach ($roomList as $room)
49 {
50 $items[] = $this->makeItem(['id' => $room['ID'], 'title' => $room['NAME'], 'color' => $room['COLOR']]);
51 }
52
53 return $items;
54 }
55
56 public function makeItem(array $item, array $options = []): Item
57 {
58 $itemOptions = [
59 'id' => $item['id'],
60 'entityId' => self::ENTITY_ID,
61 'title' => $item['title'],
62 'avatarOptions' => [
63 'bgColor' => $item['color'],
64 'bgSize' => '22px',
65 'bgImage' => '',
66 ],
67 'tabs' => 'room',
68 ];
69
70 return new Item($itemOptions);
71 }
72
73 public function getRooms()
74 {
76 return $this->getItemsFromRoomList($roomList);
77 }
78
79 public function fillDialog(Dialog $dialog): void
80 {
81 $dialog->addItems($this->getRooms());
82 }
83}
makeItem(array $item, array $options=[])
Определения roomprovider.php:56
static getRoomsList()
Определения manager.php:161
getOption(string $option, $defaultValue=null)
Определения baseprovider.php:48
addItems(array $items)
Определения dialog.php:135
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$GLOBALS['____1690880296']
Определения license.php:1
$items
Определения template.php:224
if($vatExport) $itemOptions
Определения yandex_run.php:952