<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
if(!CModule::IncludeModule("iblock"))
    return;

$arIBlock = CIBlock::GetArrayByID($arCurrentValues["IBLOCK_ID"]);
$arIBlockType = CIBlockParameters::GetIBlockTypes();

$arIBlock=array();
$rsIBlock = CIBlock::GetList(Array("sort" => "asc"), Array("TYPE" => $arCurrentValues["IBLOCK_TYPE"], "ACTIVE"=>"Y"));
while($arr=$rsIBlock->Fetch())
{
    $arIBlock[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"];
}

$rsProp = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$arCurrentValues["IBLOCK_ID"]));
while ($arr=$rsProp->Fetch())
{
    $arProperty[$arr["ID"]] = "[".$arr["CODE"]."] ".$arr["NAME"];
}

$arComponentParameters = array(
	"GROUPS" => array(

	),
	"PARAMETERS" => array(
		"SEF_MODE" => Array(),

		"IBLOCK_TYPE" => array(
			"PARENT" => "BASE",
			"NAME" => GetMessage("IBLOCK_TYPE"),
			"TYPE" => "LIST",
			"ADDITIONAL_VALUES" => "Y",
			"VALUES" => $arIBlockType,
			"REFRESH" => "Y",
		),

		"IBLOCK_ID" => array(
			"PARENT" => "BASE",
			"NAME" => GetMessage("IBLOCK_IBLOCK"),
			"TYPE" => "LIST",
			"ADDITIONAL_VALUES" => "Y",
			"VALUES" => $arIBlock,
			"REFRESH" => "Y",
		),
        "SHOW_PROPERTIES_ID" => array(
            "PARENT" => "BASE",
            "NAME" => GetMessage("IBLOCK_PROPERTY"),
            "TYPE" => "LIST",
            "MULTIPLE" => "Y",
            "VALUES" => $arProperty,
        ),
		"USER_ID" => array(
			"PARENT" => "BASE",
			"NAME" => 'ID пользователя',
            "TYPE" => "STRING",
            "DEFAULT" => $USER->GetID()
		),
        "MAIL_TO" => array(
            "PARENT" => "BASE",
            "NAME" => GetMessage("SEND_TO_MAIL"),
            "TYPE" => "STRING",
            "DEFAULT" => htmlspecialcharsbx(COption::GetOptionString("main", "email_from")),
        ),
        "MAIL_FROM" => array(
            "PARENT" => "BASE",
            "NAME" => GetMessage("SEND_FROM_MAIL"),
            "TYPE" => "STRING",
            "DEFAULT" => htmlspecialcharsbx(COption::GetOptionString("main", "email_from")),
        ),
        "OK_TEXT" => array(
            "PARENT" => "BASE",
            "NAME" => GetMessage("OK_TEXT"),
            "TYPE" => "STRING",
        ),
        "LOCAL_REDIRECT" => array(
            "PARENT" => "BASE",
            "NAME" => "Список объявлений пользователя",
            "TYPE" => "STRING",
            "DEFAULT" => "/bulletinboard/personal/",
        ),

	),
);

$arComponentParameters["PARAMETERS"]["USE_CAPTCHA"] = array(
	"PARENT" => "PARAMS",
	"NAME" => GetMessage("IBLOCK_USE_CAPTCHA"),
	"TYPE" => "CHECKBOX",
);

$arComponentParameters["PARAMETERS"]["AJAX_MODE"] = array(
    "PARENT" => "PARAMS",
    "NAME" => GetMessage("USE_AJAX"),
    "TYPE" => "CHECKBOX",
    "DEFAULT" => "Y",
);
?>