• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/main/uiselector/users.php
  • Класс: BitrixSocialnetworkIntegrationMainUISelectorUsers
  • Вызов: Users::getUserName
static function getUserName($itemCode = '')
{
	global $USER;

	$result = '';

	$entityId = (
		preg_match('/^U(d+)$/i', $itemCode, $matches)
		&& intval($matches[1]) > 0
			? intval($matches[1])
			: 0
	);

	if (
		$entityId  > 0
		&& CSocNetUser::canProfileView($USER->getId(), $entityId)
	)
	{
		$res = UserTable::getList(array(
			'filter' => array(
				'=ID' => $entityId
			),
			'select' => array('NAME', 'SECOND_NAME', 'LAST_NAME', 'LOGIN')
		));

		if ($userFields = $res->fetch())
		{
			$result = CUser::formatName(self::getNameTemplate(), $userFields, false);
		}
	}

	return $result;
}