• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/componenthelper.php
  • Класс: BitrixSocialnetworkComponentHelper
  • Вызов: ComponentHelper::notifyAuthorOnSetBlogPostLimitedViewStatusShow
static function notifyAuthorOnSetBlogPostLimitedViewStatusShow($params = array())
{
	$postId = $params['POST_ID'];
	$postFields = $params['POST_FIELDS'];
	$postUrl = $params['POST_URL'];
	$logId = $params['LOG_ID'];
	$siteId = $params['SITE_ID'];


	if (Loader::includeModule('im'))
	{
		$authorPostUrl = $postUrl;
		if (ModuleManager::isModuleInstalled("extranet"))
		{
			$tmp = CSocNetLogTools::processPath(
				array(
					"URL" => $authorPostUrl,
				),
				$postFields["AUTHOR_ID"],
				$siteId
			);
			$authorPostUrl = $tmp["URLS"]["URL"];

			$serverName = (
			mb_strpos($authorPostUrl, "http://") === 0
				|| mb_strpos($authorPostUrl, "https://") === 0
					? ""
					: $tmp["SERVER_NAME"]
				);
		}

		$messageFields = array(
			"MESSAGE_TYPE" => IM_MESSAGE_SYSTEM,
			"TO_USER_ID" => $postFields["AUTHOR_ID"],
			"FROM_USER_ID" => $postFields["AUTHOR_ID"],
			"NOTIFY_TYPE" => IM_NOTIFY_SYSTEM,
			"NOTIFY_ANSWER" => "N",
			"NOTIFY_MODULE" => "socialnetwork",
			"NOTIFY_EVENT" => "transform",
			"NOTIFY_TAG" => "SONET|BLOG_POST_CONVERT|".$postId,
			"PARSE_LINK" => "N",
			"LOG_ID" => $logId,
			"NOTIFY_MESSAGE" => Loc::getMessage('SONET_HELPER_VIDEO_CONVERSION_COMPLETED', array(
				'#POST_TITLE#' => ''.htmlspecialcharsbx($postFields["TITLE"]).''
			)),
			"NOTIFY_MESSAGE_OUT" => Loc::getMessage('SONET_HELPER_VIDEO_CONVERSION_COMPLETED', array(
					'#POST_TITLE#' => htmlspecialcharsbx($postFields["TITLE"]),
				))." ".$serverName.$authorPostUrl,
		);

		$messageFields['PUSH_MESSAGE'] = $messageFields['NOTIFY_MESSAGE'];
		$messageFields['PUSH_PARAMS'] = array(
			'ACTION' => 'transform',
			'TAG' => $messageFields['NOTIFY_TAG']
		);

		CIMNotify::add($messageFields);
	}
}