- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/extlinks.php
- Класс: CWebDavExtLinks
- Вызов: CWebDavExtLinks::getHashLink
static function getHashLink($arParams, $options, $userId = null)
{
$o = array_merge(
array_intersect_key($arParams, array(
'IBLOCK_TYPE' => true,
'IBLOCK_ID' => true,
'FOLDER' => true,
'ROOT_SECTION_ID' => true
)),
array_intersect_key($options, array(
'PASSWORD' => true,
'URL' => true,
'BASE_URL' => true,
'F_SIZE' => true,
'DESCRIPTION' => true,
'LIFETIME_TYPE' => true,
'LIFETIME_NUMBER' => true,
'SINGLE_SESSION' => true,
'LINK_TYPE' => true,
'VERSION_ID' => true,
'FILE_ID' => true,
'ELEMENT_ID' => true,
)),
array(
'USER_ID' => self::getUserID($userId),
'LIFETIME' => self::getLifeTime($options),
));
$fileName = str_replace(' ', '_', getFileName($o['URL']));
if(mb_strlen($fileName) > 25)
{
$fileName = mb_substr($fileName, 0, 25).'...';
}
$fileName = CWebDavTools::urlEncode($fileName);
$hash = self::AddExtLink($o);
return $hash != false? self::getFullExternalURL() . $hash . '/' . $fileName: false;
}