Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
actiondictionary.php
1<?php
2
4
6{
7 public const
8 ACTION_SECTION_ACCESS = 'section_access',
9 ACTION_SECTION_EDIT = 'section_edit',
10 ACTION_SECTION_ADD = 'section_add',
11 ACTION_SECTION_EVENT_VIEW_FULL = 'section_event_view_full',
12 ACTION_SECTION_EVENT_VIEW_COMMENTS = 'section_event_view_comments',
13 ACTION_SECTION_EVENT_VIEW_TIME = 'section_event_view_time',
14 ACTION_SECTION_EVENT_VIEW_TITLE = 'section_event_view_title',
15
16 ACTION_EVENT_ADD = 'event_add',
17 ACTION_EVENT_EDIT = 'event_edit',
18 ACTION_EVENT_DELETE = 'event_delete',
19 ACTION_EVENT_VIEW_FULL = 'event_view_full',
20 ACTION_EVENT_VIEW_COMMENTS = 'event_view_comments',
21 ACTION_EVENT_VIEW_TIME = 'event_view_time',
22 ACTION_EVENT_VIEW_TITLE = 'event_view_title',
23
24 ACTION_TYPE_ACCESS = 'type_access',
25 ACTION_TYPE_EDIT = 'type_edit',
26 ACTION_TYPE_VIEW = 'type_view';
27
28 public static function getOldActionKeysMap(): array
29 {
30 return [
31 self::ACTION_SECTION_ACCESS => \CCalendarSect::OPERATION_EDIT_ACCESS,
32 self::ACTION_SECTION_EDIT => \CCalendarSect::OPERATION_EDIT_SECTION,
33
34 self::ACTION_EVENT_ADD => \CCalendarSect::OPERATION_ADD,
35 self::ACTION_EVENT_EDIT => \CCalendarSect::OPERATION_EDIT,
36 self::ACTION_SECTION_EVENT_VIEW_FULL => \CCalendarSect::OPERATION_VIEW_FULL,
37 self::ACTION_SECTION_EVENT_VIEW_TIME => \CCalendarSect::OPERATION_VIEW_TIME,
38 self::ACTION_SECTION_EVENT_VIEW_TITLE => \CCalendarSect::OPERATION_VIEW_TITLE,
39
40 self::ACTION_TYPE_ACCESS => \CCalendarType::OPERATION_EDIT_ACCESS,
41 self::ACTION_TYPE_EDIT => \CCalendarType::OPERATION_EDIT,
42 self::ACTION_TYPE_VIEW => \CCalendarType::OPERATION_VIEW,
43 ];
44 }
45
46 public static function getOldActionKeyByNewActionKey(string $actionId)
47 {
48 $actionMap = self::getOldActionKeysMap();
49 if (array_key_exists($actionId, $actionMap))
50 {
51 return $actionMap[$actionId];
52 }
53 return null;
54 }
55}
static getOldActionKeyByNewActionKey(string $actionId)