- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist/param.php
- Класс: BitrixSocialnetworkComponentLogListParam
- Вызов: Param::prepareBehaviourParams
public function prepareBehaviourParams(&$componentParams): void
{
global $USER;
if (
$componentParams['AUTH'] === 'Y'
|| $USER->isAuthorized()
)
{
$presetFilterId = $this->getComponent()->getPresetFilterIdValue();
$presetFilterTopId = $this->getComponent()->getPresetFilterTopIdValue();
$request = $this->getRequest();
if(isset($componentParams['DISPLAY']))
{
$componentParams['SHOW_UNREAD'] = 'N';
$componentParams['SHOW_REFRESH'] = 'N';
$componentParams['SHOW_EVENT_ID_FILTER'] = 'N';
if (
$componentParams['DISPLAY'] > 0 // ???
|| in_array($componentParams['DISPLAY'], [ 'mine', 'forme' ])
)
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
}
elseif ($componentParams['DISPLAY'] === 'my')
{
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
}
}
if (empty($componentParams['DESTINATION']))
{
if ($componentParams['GROUP_ID'] > 0)
{
$componentParams['SET_LOG_PAGE_CACHE'] = 'Y';
$componentParams['USE_FOLLOW'] = 'N';
}
elseif ($componentParams['TO_USER_ID'] > 0)
{
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
$componentParams['USE_FOLLOW'] = 'N';
}
elseif (
$componentParams['TAG'] <> ''
|| $componentParams['FIND'] <> ''
)
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
$componentParams['SHOW_UNREAD'] = 'N';
$componentParams['USE_FOLLOW'] = 'N';
}
}
if (
(
isset($componentParams['!EXACT_EVENT_ID'])
&& $componentParams['!EXACT_EVENT_ID'] <> ''
)
|| (
isset($componentParams['EXACT_EVENT_ID'])
&& $componentParams['EXACT_EVENT_ID'] <> ''
)
|| (
isset($componentParams['EVENT_ID'])
&& !is_array($componentParams['EVENT_ID'])
&& $componentParams['EVENT_ID'] <> ''
)
|| $presetFilterId === 'extranet'
|| $componentParams['CREATED_BY_ID'] > 0
|| (
isset($componentParams['EVENT_ID'])
&& is_array($componentParams['EVENT_ID'])
&& !in_array('all', $componentParams['EVENT_ID'], true)
)
|| (
isset($componentParams['LOG_DATE_FROM'])
&& $componentParams['LOG_DATE_FROM'] <> ''
&& makeTimeStamp($componentParams['LOG_DATE_FROM'], CSite::getDateFormat('SHORT')) < time() + CTimeZone::getOffset()
)
|| (
isset($componentParams['LOG_DATE_TO'])
&& $componentParams['LOG_DATE_TO'] <> ''
&& makeTimeStamp($componentParams['LOG_DATE_TO'], CSite::getDateFormat('SHORT')) < time() + CTimeZone::getOffset()
)
)
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
$componentParams['SHOW_UNREAD'] = 'N';
$componentParams['USE_FOLLOW'] = 'N';
}
if ($componentParams['IS_CRM'] === 'Y')
{
Util::checkEmptyParamString($componentParams, 'CRM_ENTITY_TYPE', '');
Util::checkEmptyParamInteger($componentParams, 'CRM_ENTITY_ID', 0);
if ($componentParams['CRM_ENTITY_TYPE'] <> '')
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
$componentParams['SHOW_UNREAD'] = 'N';
}
elseif ($presetFilterTopId)
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SHOW_UNREAD'] = 'N';
}
$componentParams['CRM_EXTENDED_MODE'] = (isset($componentParams['CRM_EXTENDED_MODE']) && $componentParams['CRM_EXTENDED_MODE'] === 'Y' ? 'Y' : 'N');
}
if ($componentParams['LOG_CNT'] > 0)
{
$componentParams['SHOW_NAV_STRING'] = 'N';
$componentParams['SHOW_REFRESH'] = 'N';
}
if (
(
!isset($componentParams['USE_FAVORITES'])
|| $componentParams['USE_FAVORITES'] !== 'N'
)
&& isset($componentParams['FAVORITES'])
&& $componentParams['FAVORITES'] === 'Y'
)
{
$componentParams['SET_LOG_COUNTER'] = 'N';
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
$componentParams['SHOW_UNREAD'] = 'N';
}
if ((int)$request->get('pagesize') > 0)
{
$componentParams['SET_LOG_PAGE_CACHE'] = 'N';
}
}
}