Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
landing.php
1<?php
3
4use \Bitrix\Landing\Source;
5use \Bitrix\Main\Localization\Loc;
6use \Bitrix\Main\Event;
7use \Bitrix\Main\EventResult;
8
9Loc::loadMessages(__FILE__);
10
12{
18 public static function onSourceBuildHandler(Event $event)
19 {
20 $result = [];
21
22 // pages
23 $result[] = [
24 'SOURCE_ID' => 'landing',
25 'TITLE' => Loc::getMessage('LANDING_CONNECTOR_SOURCE_TITLE'),
26 'TYPE' => Source\Selector::SOURCE_TYPE_PRESET,
27 'SETTINGS' => [
28 'FILTER' => [
29 [
30 'key' => 'LANDING',
31 'name' => Loc::getMessage('LANDING_CONNECTOR_SOURCE_TITLE'),
32 'value' => ['VALUE' => '']
33 ]
34 ],
35 'DETAIL_PAGE' => false
36 ],
37 'SOURCE_FILTER' => [
38 ],
39 'DATA_SETTINGS' => [
40 'FIELDS' => [
41 [
42 'id' => 'TITLE',
43 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_TITLE'),
44 'type' => \Bitrix\Landing\Node\Type::TEXT
45 ],
46 [
47 'id' => 'DESCRIPTION',
48 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_DESCRIPTION'),
49 'type' => \Bitrix\Landing\Node\Type::TEXT
50 ],
51 [
52 'id' => 'IMAGE',
53 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_IMAGE'),
54 'type' => \Bitrix\Landing\Node\Type::IMAGE
55 ],
56 [
57 'id' => 'LINK',
58 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_LINK'),
59 'type' => \Bitrix\Landing\Node\Type::LINK,
60 'actions' => [
61 [
62 'type' => 'landing',
63 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_LINK')
64 ],
65 [
66 'type' => 'link',
67 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_LINK_LINK')
68 ]
69 ]
70 ]
71 ],
72 'ORDER' => [
73 [
74 'id' => 'VIEWS',
75 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_VIEWS')
76 ],
77 [
78 'id' => 'DATE_CREATE',
79 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_DATE_CREATE')
80 ],
81 [
82 'id' => 'DATE_MODIFY',
83 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_DATE_MODIFY')
84 ],
85 [
86 'id' => 'TITLE',
87 'name' => Loc::getMessage('LANDING_CONNECTOR_FIELD_TITLE')
88 ]
89 ]
90 ],
91 'DATA_LOADER' => '\Bitrix\Landing\DataLoader\Landing'
92 ];
93
94 // chats (system item)
95 if (false)
96 $result[] = [
97 'SOURCE_ID' => 'chat',
98 'TITLE' => 'Chats',
99 'TYPE' => Source\Selector::SOURCE_TYPE_PRESET,
100 'SETTINGS' => [
101 'FILTER' => [
102 [
103 'key' => 'NULL',
104 'name' => 'Chats',
105 'value' => ['VALUE' => '']
106 ]
107 ],
108 'DETAIL_PAGE' => false
109 ],
110 'DATA_SETTINGS' => [
111 'FIELDS' => [
112 [
113 'id' => 'NAME',
114 'name' => 'NAME',
115 'type' => \Bitrix\Landing\Node\Type::TEXT
116 ],
117 [
118 'id' => 'WORK_POSITION',
119 'name' => 'WORK_POSITION',
120 'type' => \Bitrix\Landing\Node\Type::TEXT
121 ],
122 [
123 'id' => 'SEND',
124 'name' => 'SEND',
125 'type' => \Bitrix\Landing\Node\Type::LINK
126 ],
127 [
128 'id' => 'AVATAR',
129 'name' => 'AVATAR',
130 'type' => \Bitrix\Landing\Node\Type::IMAGE
131 ]
132 ],
133 'ORDER' => [
134 [
135 'id' => 'NAME',
136 'name' => 'NAME'
137 ]
138 ]
139 ],
140 'DATA_LOADER' => '\Bitrix\Landing\DataLoader\Chat'
141 ];
142
143 return new EventResult(EventResult::SUCCESS, $result, 'landing');
144 }
145}
static onSourceBuildHandler(Event $event)
Definition landing.php:18
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29