AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.15.4.59
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/modules/socialnetwork/lib/commentaux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/socialnetwork/lib/commentaux/fileversion.php
<?php

namespace Bitrix\Socialnetwork\CommentAux;

use Bitrix\Disk\Configuration;
use Bitrix\Main\UserTable;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Loader;

Loc::loadMessages(__FILE__);

final class FileVersion extends Base
{
	public const TYPE = 'FILEVERSION';
	public const POST_TEXT = 'commentAuxFileVersion';

	public function getParamsFromFields($fields = []): array
	{
		$params = [];

		if (!empty($fields['AUTHOR_ID']))
		{
			$params['userId'] = (int)$fields['AUTHOR_ID'];
		}

		return $params;
	}

	public function getText(): string
	{
		static $userCache = [];

		$params = $this->params;

		$gender = '';

		if (
			!empty($params['userId'])
			&& (int)$params['userId'] > 0
		)
		{
			if (isset($userCache[(int)$params['userId']]['PERSONAL_GENDER']))
			{
				$gender = $userCache[(int)$params['userId']]['PERSONAL_GENDER'];
			}
			else
			{
				$res = UserTable::getList([
					'filter' => [
						'=ID' => (int)$params['userId'],
					],
					'select' => [ 'ID', 'PERSONAL_GENDER' ],
				]);

				if ($user = $res->fetch())
				{
					$userCache[$user['ID']] = $user;
					$gender = $user['PERSONAL_GENDER'];
				}
			}
		}

		if (Loader::includeModule('disk') && !Configuration::isEnabledKeepVersion())
		{
			return Loc::getMessage('SONET_COMMENTAUX_HEAD_FILEVERSION_TEXT' . (!empty($gender) ? '_' . $gender : ''));
		}

		return Loc::getMessage('SONET_COMMENTAUX_FILEVERSION_TEXT' . (!empty($gender) ? '_' . $gender : ''));
	}

	protected function getRatingNotificationFollowValue(int $userId = 0, array $ratingVoteParams = [], array $fields = [])
	{
		return \CSocNetLogFollow::getExactValueByRating(
			$userId,
			'BLOG_COMMENT',
			$fields['ID']
		);
	}

	protected function getRatingNotificationNotigyTag(array $ratingVoteParams = [], array $fields = []): string
	{
		return 'RATING|' . ($ratingVoteParams['VALUE'] >= 0 ? '' : 'DL|') . 'BLOG_COMMENT|' . $fields['ID'];
	}
}

Anon7 - 2022
AnonSec Team