• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/main/uiselector/entities.php
  • Класс: BitrixSocialnetworkIntegrationMainUISelectorEntities
  • Вызов: Entities::getList
static function getList($params = array())
{
	$itemsSelected = $params['itemsSelected'];

	$entities = array(
		'USERS' => array(),
		'SONETGROUPS' => array(),
		'GROUPS' => array(),
		'DEPARTMENTS' => array()
	);

	$sonetGroupIdList = $userIdList = $departmentIdList = array();
	foreach ($itemsSelected as $code => $entityGroup)
	{
		if ($entityGroup == 'users')
		{
			$userIdList[] = str_replace('U', '', $code);
		}
		elseif ($entityGroup == 'sonetgroups')
		{
			$sonetGroupIdList[] = str_replace('SG', '', $code);
		}
		elseif ($entityGroup == 'department')
		{
			$departmentIdList[] = str_replace('DR', '', $code);
		}
	}

	if (!empty($userIdList))
	{
		$entities['USERS'] = self::getUsers(array('id' => $userIdList));
	}

	if (!empty($sonetGroupIdList))
	{
		$entities['SONETGROUPS'] = self::getSonetgroups(array('id' => $sonetGroupIdList));
	}

	if (!empty($departmentIdList))
	{
		$entities['DEPARTMENTS'] = self::getDepartments(array('id' => $departmentIdList));
	}

	if (
		!Handler::isExtranetUser()
		&& BitrixSocialnetworkComponentHelper::getAllowToAllDestination()
	)
	{
		$entities['GROUPS'] = array(
			'UA' => array(
				'id' => 'UA',
				'name' => (
				ModuleManager::isModuleInstalled('intranet')
					? Loc::getMessage("MPF_DESTINATION_3")
					: Loc::getMessage("MPF_DESTINATION_4")
				)
			)
		);
	}
	else
	{
		$entities['GROUPS'] = array();
	}

	return $entities;
}