Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/socialnetwork/lib/commentaux/ |
Upload File : |
<?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']; } } } $availableGenders = ['M', 'F']; if (!in_array($gender, $availableGenders, true)) { $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']; } }