- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist/paramphotogallery.php
- Класс: BitrixSocialnetworkComponentLogListParamPhotogallery
- Вызов: ParamPhotogallery::preparePhotogalleryParams
public function preparePhotogalleryParams(&$componentParams): void
{
if (!ModuleManager::isModuleInstalled('photogallery'))
{
return;
}
Util::checkEmptyParamInteger($componentParams, 'PHOTO_COUNT', 6);
Util::checkEmptyParamInteger($componentParams, 'PHOTO_THUMBNAIL_SIZE', 48);
$folderUsers = $this->getComponent()->getPathInstance()->getFolderUsersValue();
$folderWorkgroups = $this->getComponent()->getPathInstance()->getFolderWorkgroupsValue();
Util::checkEmptyParamString($componentParams, 'PHOTO_USER_IBLOCK_TYPE', 'photos');
if (
(
!isset($componentParams['PHOTO_USER_IBLOCK_ID'])
|| (int)$componentParams['PHOTO_USER_IBLOCK_ID'] <= 0
)
&& Loader::includeModule('iblock')
)
{
$res = CIBlock::getList(
[],
[
'SITE_ID' => SITE_ID,
'=CODE' => 'user_photogallery'
]
);
if ($iblockFields = $res->fetch())
{
$componentParams['PHOTO_USER_IBLOCK_ID'] = $iblockFields['ID'];
}
}
if (
(
!isset($componentParams['PHOTO_FORUM_ID'])
|| (int)$componentParams['PHOTO_FORUM_ID'] <= 0
)
&& Loader::includeModule('forum')
)
{
$res = CForumNew::getListEx(
[],
[
'SITE_ID' => SITE_ID,
'XML_ID' => 'PHOTOGALLERY_COMMENTS'
]
);
if ($forumFields = $res->fetch())
{
$componentParams['PHOTO_FORUM_ID'] = $forumFields['ID'];
}
}
Util::checkEmptyParamString($componentParams, 'PATH_TO_USER_PHOTO', $folderUsers.'user/#user_id#/photo/');
Util::checkEmptyParamString($componentParams, 'PATH_TO_GROUP_PHOTO', $folderWorkgroups.'group/#group_id#/photo/');
Util::checkEmptyParamString($componentParams, 'PATH_TO_USER_PHOTO_SECTION', $folderUsers.'user/#user_id#/photo/album/#section_id#/');
Util::checkEmptyParamString($componentParams, 'PATH_TO_GROUP_PHOTO_SECTION', $folderWorkgroups.'group/#group_id#/photo/album/#section_id#/');
Util::checkEmptyParamString($componentParams, 'PATH_TO_USER_PHOTO_ELEMENT', $folderUsers.'user/#user_id#/photo/photo/#section_id#/#element_id#/');
Util::checkEmptyParamString($componentParams, 'PATH_TO_GROUP_PHOTO_ELEMENT', $folderWorkgroups.'group/#group_id#/photo/#section_id#/#element_id#/');
}