.parameters.php 10.2 KB
<?
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),

	),
);
?>