• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/webdavstorage.php
  • Класс: CWebDavStorageCore
  • Вызов: CWebDavStorageCore::init
protected function init($reinit = false, $params = array())
{
	if($this->isSetWebDav() && !$reinit)
	{
		return $this;
	}

	CModule::IncludeModule('webdav');

	$key = $this->getStorageId();
	//$params = array();
	if(empty($key['IBLOCK_SECTION_ID']))
	{
		throw new Exception('Wrong storage key. Not set section id');
	}
	$params['ROOT_SECTION_ID'] = $key['IBLOCK_SECTION_ID'];
	$params['PLEASE_DO_NOT_MAKE_REDIRECT'] = true;
	//todo what is it? socnet magic to published docs
	global $USER;
	$params['DOCUMENT_TYPE'] = array('webdav', 'CIBlockDocumentWebdavSocnet', 'iblock_'.$key['IBLOCK_SECTION_ID'].'_user_'.intval($USER->getId()));

	$className = $this->getStorageClassName();
	$webdav = new $className($key['IBLOCK_ID'], '', $params);
	$webdav->attributes['user_id'] = $USER->getId();

	return $this->setWebDav($webdav);
}