• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist.php
  • Класс: BitrixSocialnetworkComponentLogList
  • Вызов: LogList::prepareData
protected function prepareData()
{
	global $USER;

	$request = $this->getRequest();
	$processorInstance = $this->getProcessorInstance();
	$logPageProcessorInstance = $this->getLogPageProcessorInstance();
	$counterProcessorInstance = $this->getCounterProcessorInstance();
	$pathsProcessorInstance = $this->getPathInstance();
	$assetsProcessorInstance = $this->getAssetsInstance();

	$result = [];

	if (!$assetsProcessorInstance->checkRefreshNeeded($result))
	{
		return $result;
	}

	$this->getGratitudesInstance()->prepareGratPostFilter($result);

	$result['isExtranetSite'] = $this->getExtranetSiteValue();
	$result['SHOW_FOLLOW_CONTROL'] = 'Y';
	$result['CAN_DELETE'] = CSocNetUser::isCurrentUserModuleAdmin(SITE_ID, false);
	$result['ENTITIES_CORRESPONDENCE'] = [];

	$result['PATH_TO_LOG_TAG'] = $pathsProcessorInstance->getFolderUsersValue().'log/?TAG=#tag#';
	if (
		defined('SITE_TEMPLATE_ID')
		&& SITE_TEMPLATE_ID === 'bitrix24'
	)
	{
		$result['PATH_TO_LOG_TAG'] .= '&apply_filter=Y';
	}

	$result['AJAX_CALL'] = (
		!empty($this->arParams['TARGET'])
		|| $request->get('logajax') <> ''
	);
	$result['bReload'] = (
		$result['AJAX_CALL']
		&& (
			$request->get('RELOAD') === 'Y'
			|| (
				isset($this->arParams['RELOAD'])
				&& $this->arParams['RELOAD'] === 'Y'
			)
		)
	);
	$result['SHOW_UNREAD'] = $this->arParams['SHOW_UNREAD'];
	$result['currentUserId'] = (int)$USER->getId();

	$assetsProcessorInstance->getAssetsCheckSum($result);

	$logPageProcessorInstance->preparePrevPageLogId();
	$this->setCurrentUserAdmin(CSocNetUser::isCurrentUserModuleAdmin());
	$processorInstance->getMicroblogUserId($result);

	$result['TZ_OFFSET'] = CTimeZone::getOffset();
	$result['FILTER_ID'] = (
	!empty($this->arParams['FILTER_ID'])
		? $this->arParams['FILTER_ID']
		: 'LIVEFEED'.(!empty($this->arParams['GROUP_ID']) ? '_SG'.$this->arParams['GROUP_ID'] : '')
	);

	CSocNetTools::initGlobalExtranetArrays();

	if (
		$this->arParams['AUTH'] === 'Y'
		|| Util::checkUserAuthorized()
	)
	{
		$result['IS_FILTERED'] = false;

		$processorInstance->prepareContextData($result);
		$this->setTitle([
			'GROUP' => ($result['Group'] ?? []),
		]);

		$result['Events'] = false;

		$processorInstance->processFilterData($result);
		$processorInstance->processNavData($result);
		$processorInstance->processOrderData();
		$counterProcessorInstance->processCounterTypeData($result);
		$processorInstance->processLastTimestamp($result);
		$processorInstance->processListParams($result);
		$logPageProcessorInstance->getLogPageData($result);
		$processorInstance->setListFilter($result);
		$processorInstance->processSelectData($result);

		$this->getEntriesData($result);

		$processorInstance->processFavoritesData($result);
		$processorInstance->processDiskUFEntities();
		$processorInstance->processCrmActivities($result);

		$logPageProcessorInstance->deleteLogPageData($result);

		$processorInstance->processNextPageSize($result);
		$processorInstance->processEventsList($result, 'main');
		$processorInstance->processEventsList($result, 'pinned');

		$processorInstance->warmUpStaticCache($result);

		if (
			$this->arParams['LOG_ID'] > 0
			&& (
				!is_array($result['Events'])
				|| count($result['Events']) <= 0
			)
		)
		{
			$this->errorCollection[] = new Error(Loc::getMessage('SONET_LOG_LIST_ENTRY_NOT_FOUND'));
			return false;
		}

		$processorInstance->processContentList($result);

		$result['WORKGROUPS_PAGE'] = $pathsProcessorInstance->getFolderWorkgroupsValue();

		$counterProcessorInstance->setLogCounter($result);
		$processorInstance->getExpertModeValue($result);
		$logPageProcessorInstance->setLogPageData($result);

		$processorInstance->getUnreadTaskCommentsIdList($result);
		$processorInstance->getResultTaskCommentsIdList($result);

		$counterProcessorInstance->clearLogCounter($result);
		$this->processLogFormComments($result);

		$result['bGetComments'] = $this->getCommentsNeededValue();
		$result['GET_COMMENTS'] = ($this->getCommentsNeededValue() ? 'Y' : 'N');

		$processorInstance->getSmiles($result);
	}
	else
	{
		$result['NEED_AUTH'] = 'Y';
	}

	// compatibility with old component/template
	$this->arParams['SHOW_UNREAD'] = $result['SHOW_UNREAD'];

	return $result;
}