• Модуль: fileman
  • Путь к файлу: ~/bitrix/modules/fileman/classes/general/sticker.php
  • Класс: CSticker
  • Вызов: CSticker::GetUserName
static function GetUserName($id = false)
{
	global $USER;
	static $arUsersCache = array();

	if ($id !== false)
	{
		if (isset($arUsersCache[$id]))
			return $arUsersCache[$id];

		$rsu = CUser::GetByID($id);
		if($arUser = $rsu->Fetch())
			$arUsersCache[$id] = htmlspecialcharsback(CUser::FormatName(CSite::GetNameFormat(), $arUser));
		else
			$arUsersCache[$id] = '- Unknown -';
	}
	else
	{
		$id = $USER->GetId();
		if (isset($arUsersCache[$id]))
			return $arUsersCache[$id];

		$arUsersCache[$id] = htmlspecialcharsback($USER->GetFormattedName());
	}

	return $arUsersCache[$id];
}