• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/log_tools.php
  • Класс: CSocNetLogComponent
  • Вызов: CSocNetLogComponent::getCommentRatingType
static function getCommentRatingType($logEventId, $logId = false)
{
	$res = "LOG_COMMENT";

	$arCommentEventMeta = CSocNetLogTools::FindLogCommentEventByLogEventID($logEventId);
	if (
		$arCommentEventMeta
		&& isset($arCommentEventMeta["RATING_TYPE_ID"])
	)
	{
		$res = $arCommentEventMeta["RATING_TYPE_ID"];
	}
	elseif (
		$logEventId === "photo_photo"
		&& (int)$logId > 0
	)
	{
		$commentType = CSocNetPhotoCommentEvent::FindLogType($logId);
		if (
			$commentType
			&& isset($commentType["TYPE"])
		)
		{
			if ($commentType["TYPE"] === "FORUM")
			{
				$res = "FORUM_POST";
			}
			elseif ($commentType["TYPE"] === "BLOG")
			{
				$res = "BLOG_COMMENT";
			}
		}
	}
	elseif (in_array($logEventId, array("wiki", "calendar", "news", "lists_new_element", "timeman_entry", "report")))
	{
		$res = "FORUM_POST";
	}
	elseif ($logEventId === "idea")
	{
		$res = "BLOG_COMMENT";
	}

	return $res;
}