Blame view

bitrix/components/citrus/contests/.parameters.php 10.2 KB
60c6f0893   root   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
  <?
  if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
  
  if(!CModule::IncludeModule("iblock"))
  	return;
  
  $arTypesEx = CIBlockParameters::GetIBlockTypes(Array("-"=>" "));
  
  $arIBlocks=Array();
  $db_iblock = CIBlock::GetList(Array("SORT"=>"ASC"), Array("SITE_ID"=>$_REQUEST["site"], "TYPE" => ($arCurrentValues["IBLOCK_TYPE"]!="-"?$arCurrentValues["IBLOCK_TYPE"]:"")));
  while($arRes = $db_iblock->Fetch()) {
  	$arIBlocks[$arRes["ID"]] = $arRes["NAME"];
  }
  
  $arProperty = array();
  $arProperty_N = array();
  $rsProp = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$arCurrentValues["IBLOCK_ID"]));
  while ($arr=$rsProp->Fetch())
  {
  	if($arr["PROPERTY_TYPE"] != "F")
  		$arProperty[$arr["CODE"]] = "[".$arr["CODE"]."] ".$arr["NAME"];
  
  	if($arr["PROPERTY_TYPE"] == "N")
  		$arProperty_N[$arr["CODE"]] = "[".$arr["CODE"]."] ".$arr["NAME"];
  }
  $arProperty_LNS = $arProperty;
  
  $arIBlock_LINK = array();
  $rsIblock = CIBlock::GetList(Array("sort" => "asc"), Array("TYPE" => $arCurrentValues["LINK_IBLOCK_TYPE"], "ACTIVE"=>"Y"));
  while($arr=$rsIblock->Fetch())
  	$arIBlock_LINK[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"];
  
  $arProperty_LINK = array();
  $rsProp = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$arCurrentValues["LINK_IBLOCK_ID"]));
  while ($arr=$rsProp->Fetch())
  {
  	if (in_array($arr["PROPERTY_TYPE"], array("E")))
  	{
  		$arProperty_LINK[$arr["CODE"]] = "[".$arr["CODE"]."] ".$arr["NAME"];
  	}
  }
  
  $arUserFields_S = array("-"=>" ");
  $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_".$arCurrentValues["IBLOCK_ID"]."_SECTION");
  foreach($arUserFields as $FIELD_NAME=>$arUserField)
  	if($arUserField["USER_TYPE"]["BASE_TYPE"]=="string")
  		$arUserFields_S[$FIELD_NAME] = $arUserField["LIST_COLUMN_LABEL"]? $arUserField["LIST_COLUMN_LABEL"]: $FIELD_NAME;
  
  $arOffers = CIBlockPriceTools::GetOffersIBlock($arCurrentValues["IBLOCK_ID"]);
  $OFFERS_IBLOCK_ID = is_array($arOffers)? $arOffers["OFFERS_IBLOCK_ID"]: 0;
  $arProperty_Offers = array();
  if($OFFERS_IBLOCK_ID)
  {
  	$rsProp = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$OFFERS_IBLOCK_ID));
  	while($arr=$rsProp->Fetch())
  	{
  		if($arr["PROPERTY_TYPE"] != "F")
  			$arProperty_Offers[$arr["CODE"]] = "[".$arr["CODE"]."] ".$arr["NAME"];
  	}
  }
  
  $arAscDesc = array(
  	"asc" => GetMessage("IBLOCK_SORT_ASC"),
  	"desc" => GetMessage("IBLOCK_SORT_DESC"),
  );
  
  $arSorts = Array("ASC"=>GetMessage("T_IBLOCK_DESC_ASC"), "DESC"=>GetMessage("T_IBLOCK_DESC_DESC"));
  $arSortFields = Array(
  		"ID"=>GetMessage("T_IBLOCK_DESC_FID"),
  		"NAME"=>GetMessage("T_IBLOCK_DESC_FNAME"),
  		"ACTIVE_FROM"=>GetMessage("T_IBLOCK_DESC_FACT"),
  		"SORT"=>GetMessage("T_IBLOCK_DESC_FSORT"),
  		"TIMESTAMP_X"=>GetMessage("T_IBLOCK_DESC_FTSAMP")
  	);
  
  $arComponentParameters = array(
  	"GROUPS" => array(
  		"G_CONTESTS_LIST" => array(
  			"NAME" => GetMessage("GROUPS_CONTESTS_LIST"),
  		),
  		"G_CONTESTS_DETAIL" => array(
  			"NAME" => GetMessage("GROUPS_CONTESTS_DETAIL"),
  		),
  		"G_WINNERS" => array(
  			"NAME" => GetMessage("GROUPS_WINNERS"),
  		),
  		"G_JURY" => array(
  			"NAME" => GetMessage("GROUPS_JURY"),
  		),
  		"G_JURY_DETAIL" => array(
  			"NAME" => GetMessage("GROUPS_JURY_DETAIL"),
  		),
  		"G_TITLE" => array(
  			"NAME" => GetMessage("GROUPS_TITLE"),
  		),
  
  	),
  	"PARAMETERS" => array(
  	"AJAX_MODE" => array(),
  		"IBLOCK_TYPE" => Array(
  			"PARENT" => "BASE",
  			"NAME" => GetMessage("IBLOCK_TYPE"),
  			"TYPE" => "LIST",
  			"VALUES" => $arTypesEx,
  			"DEFAULT" => "news",
  			"REFRESH" => "Y",
  		),
  		"IBLOCK_ID" => Array(
  			"PARENT" => "BASE",
  			"NAME" => GetMessage("IBLOCK_ID"),
  			"TYPE" => "LIST",
  			"VALUES" => $arIBlocks,
  			"DEFAULT" => '={$_REQUEST["ID"]}',
  			"ADDITIONAL_VALUES" => "Y",
  			"REFRESH" => "Y",
  		),
  		"SEF_MODE" => Array(
  			"SEF_BASE_URL" => array(
  				"PARENT" => "BASE",
  				"NAME"=>GetMessage("CP_BMS_SEF_BASE_URL"),
  				"TYPE"=>"STRING",
  				"DEFAULT"=>'/archive/contests/',
  			),
  			"list" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("CONTESTS"),
  				"#CON_CODE#/",
  				"BASE"
  			),
  			"contests" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("WINNERS"),
  				"#CON_CODE#/winners/",
  				"BASE"
  			),
  			"JUVENILE_PAGE_URL" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("JUVENILE"),
  				"#CON_CODE#/winners/juvenile/",
  				"BASE"
  			),
  			"terms" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("TERMS"),
  				"#CON_CODE#/terms/",
  				"BASE"
  			),
  			"prizes" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("PRIZES"),
  				"#CON_CODE#/prizes/",
  				"BASE"
  			),
  			"programs" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("PROGRAM"),
  				"#CON_CODE#/programs/",
  				"BASE"
  			),
  			"jury" => CIBlockParameters::GetPathTemplateParam(
  				"SECTION",
  				"SECTION_PAGE_URL",
  				GetMessage("JURY"),
  				"#CON_CODE#/jury/",
  				"BASE"
  			),
  			"jury_detail" => CIBlockParameters::GetPathTemplateParam(
  				"DETAIL",
  				"SECTION_PAGE_URL",
  				GetMessage("JURY_DETAIL"),
  				"#CON_CODE#/jury/#ELEMENT_CODE#/",
  				"BASE"
  			),
  		),
  		// Список конкурсов
  		"PAGE_CON_COUNT" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("IBLOCK_PAGE_ELEMENT_COUNT"),
  			"TYPE" => "STRING",
  			"DEFAULT" => "30",
  		),
  		////
  		"CON_SORT_BY1" => Array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("T_IBLOCK_DESC_IBORD1"),
  			"TYPE" => "LIST",
  			"DEFAULT" => "ACTIVE_FROM",
  			"VALUES" => $arSortFields,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		"CON_SORT_ORDER1" => Array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("T_IBLOCK_DESC_IBBY1"),
  			"TYPE" => "LIST",
  			"DEFAULT" => "DESC",
  			"VALUES" => $arSorts,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		"CON_SORT_BY2" => Array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("T_IBLOCK_DESC_IBORD2"),
  			"TYPE" => "LIST",
  			"DEFAULT" => "SORT",
  			"VALUES" => $arSortFields,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		"CON_SORT_ORDER2" => Array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("T_IBLOCK_DESC_IBBY2"),
  			"TYPE" => "LIST",
  			"DEFAULT" => "ASC",
  			"VALUES" => $arSorts,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		/////
  		"TITLE_CON_COUNT" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("TITLE_CON_COUNT"),
  			"TYPE" => "STRING",
  			"DEFAULT" => "Архив конкурсов",
  		),
  		"LIST_PROPERTY_CODE" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("IBLOCK_PROPERTY"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "Y",
  			"ADDITIONAL_VALUES" => "Y",
  			"VALUES" => $arProperty_LNS,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		"LIST_META_KEYWORDS" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("CP_BC_LIST_META_KEYWORDS"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"ADDITIONAL_VALUES" => "N",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  		"LIST_META_DESCRIPTION" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("CP_BC_LIST_META_DESCRIPTION"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"ADDITIONAL_VALUES" => "N",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  		"LIST_BROWSER_TITLE" => array(
  			"PARENT" => "G_CONTESTS_LIST",
  			"NAME" => GetMessage("CP_BC_LIST_BROWSER_TITLE"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"DEFAULT" => "-",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  // Детальная страница конкурса
  		"DETAIL_PROPERTY_CODE" => array(
  			"PARENT" => "G_CONTESTS_DETAIL",
  			"NAME" => GetMessage("IBLOCK_PROPERTY"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "Y",
  			"ADDITIONAL_VALUES" => "Y",
  			"VALUES" => $arProperty_LNS,
  			"ADDITIONAL_VALUES" => "Y",
  		),
  		"DETAIL_META_KEYWORDS" => array(
  			"PARENT" => "G_CONTESTS_DETAIL",
  			"NAME" => GetMessage("CP_BC_LIST_META_KEYWORDS"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"ADDITIONAL_VALUES" => "N",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  		"DETAIL_META_DESCRIPTION" => array(
  			"PARENT" => "G_CONTESTS_DETAIL",
  			"NAME" => GetMessage("CP_BC_LIST_META_DESCRIPTION"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"ADDITIONAL_VALUES" => "N",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  		"DETAIL_BROWSER_TITLE" => array(
  			"PARENT" => "G_CONTESTS_DETAIL",
  			"NAME" => GetMessage("CP_BC_LIST_BROWSER_TITLE"),
  			"TYPE" => "LIST",
  			"MULTIPLE" => "N",
  			"DEFAULT" => "-",
  			"VALUES" => array_merge(Array("-"=>" ", "NAME" => GetMessage("IBLOCK_FIELD_NAME")), $arProperty_LNS),
  		),
  			"list" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("CONTESTS"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  			"contests" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("WINNERS"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  
  			"terms" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("TERMS"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  
  			"prizes" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("PRIZES"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  			"programs" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("PROGRAM"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  			"jury" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("JURY"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  			"jury_detail" => array(
  				"PARENT" => "G_TITLE",
  				"NAME" => GetMessage("JURY_DETAIL"),
  				"TYPE" => "STRING",
  				"DEFAULT" => "",
  			),
  		"CACHE_TIME"  =>  Array("DEFAULT"=>3600),
  
  	),
  );
  ?>