• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/sharepoint.php
  • Класс: CAllIntranetSharepoint
  • Вызов: CAllIntranetSharepoint::_CreateProperty
static function _CreateProperty($arProp)
{
	$arProperty = array(
		'IBLOCK_ID' => $arProp['IBLOCK_ID'],
		'NAME' => $arProp['NAME'],
		'ACTIVE' => 'Y',
		'CODE' => $arProp['CODE'],
		'PROPERTY_TYPE' => $arProp['TYPE'],
		'ROW_COUNT' => 1,
		'COL_COUNT' => 30,
		'LIST_TYPE' => $arProp['LIST_TYPE'] ? $arProp['LIST_TYPE'] : 'L',
		// the only sharepoint field that can contain files is Attachments. so F-fields should be multiple.
		'MULTIPLE' => $arProp['MULTIPLE'],
		'USER_TYPE' => $arProp['USER_TYPE'],
		'CHECK_PERMISSIONS' => 'N'
	);

	if (is_array($arProp['ENUM']))
	{
		$arProperty['VALUES'] = array();

		foreach ($arProp['ENUM'] as $key => $value)
		{
			$arProperty['VALUES'][] = array(
				'VALUE' => $value,
				'SORT' => 100*intval($key+1),
				'DEF' => $value == $arProp['ENUM_DEFAULT'] ? 'Y' : 'N',
			);
		}
	}

	$ibp = new CIBlockProperty();
	return $ibp->Add($arProperty);
}