24 $formId =
'ui-timeline-comment-'.$name;
27 $isUploadFilesAvailable = isset($fileFields[$this->filesUserFieldName]);
30 'SELECTOR_VERSION' => 2,
34 'Bold',
'Italic',
'Underline',
'Strike',
35 'ForeColor',
'FontList',
'FontSizeList',
'RemoveFormat',
36 'Quote',
'Code',
'InsertCut',
37 'CreateLink',
'Image',
'Table',
'Justify',
38 'InsertOrderedList',
'InsertUnorderedList',
39 'SmileList',
'Source',
'UploadImage',
'InputVideo',
'MentionUser'
42 ($isUploadFilesAvailable ?
'UploadImage' :
null),
55 'documentCSS' =>
'body {color:#434343;background:#F7FBE9}',
58 'minBodyWidth' =>
'100%',
59 'normalBodyWidth' =>
'100%',
61 'minBodyHeight' => 100,
62 'showTaskbars' =>
false,
63 'showNodeNavi' =>
false,
65 'autoResizeOffset' => 50,
67 'saveOnBlur' =>
false,
70 'limitPhpAccess' =>
false,
71 'setFocusAfterShow' =>
true,
72 'askBeforeUnloadPage' =>
false,
73 'useFileDialogs' =>
false,
75 [
'id' =>
'Bold',
'compact' =>
true,
'sort' => 10],
76 [
'id' =>
'Italic',
'compact' =>
true,
'sort' => 20],
77 [
'id' =>
'Underline',
'compact' =>
true,
'sort' => 30],
78 [
'id' =>
'Strikeout',
'compact' =>
true,
'sort' => 40],
79 [
'id' =>
'RemoveFormat',
'compact' =>
true,
'sort' => 50],
80 [
'id' =>
'Color',
'compact' =>
true,
'sort' => 60],
81 [
'id' =>
'FontSelector',
'compact' =>
false,
'sort' => 70],
82 [
'id' =>
'FontSize',
'compact' =>
false,
'sort' => 80],
83 [
'separator' =>
true,
'compact' =>
false,
'sort' => 90],
84 [
'id' =>
'OrderedList',
'compact' =>
true,
'sort' => 100],
85 [
'id' =>
'UnorderedList',
'compact' =>
true,
'sort' => 110],
86 [
'id' =>
'AlignList',
'compact' =>
false,
'sort' => 120],
87 [
'separator' =>
true,
'compact' =>
false,
'sort' => 130],
88 [
'id' =>
'InsertLink',
'compact' =>
true,
'sort' => 140,
'wrap' =>
'bx-b-link-'.$formId],
89 [
'id' =>
'InsertImage',
'compact' =>
false,
'sort' => 150],
90 [
'id' =>
'InsertVideo',
'compact' =>
true,
'sort' => 160,
'wrap' =>
'bx-b-video-'.$formId],
91 [
'id' =>
'InsertTable',
'compact' =>
false,
'sort' => 170],
92 [
'id' =>
'Code',
'compact' =>
true,
'sort' => 180],
93 [
'id' =>
'Quote',
'compact' =>
true,
'sort' => 190,
'wrap' =>
'bx-b-quote-'.$formId],
94 [
'separator' =>
true,
'compact' =>
false,
'sort' => 200],
95 [
'id' =>
'BbCode',
'compact' =>
true,
'sort' => 220],
96 [
'id' =>
'More',
'compact' =>
true,
'sort' => 230],
99 'USE_CLIENT_DATABASE' =>
'Y',
105 'UPLOAD_FILE' => $isUploadFilesAvailable,
106 'UPLOAD_FILE_PARAMS' => [
'width' => 400,
'height' => 400],
107 'UPLOAD_WEBDAV_ELEMENT' => $fileFields[$this->filesUserFieldName] ??
false,
110 return new Component(
'bitrix:main.post.form',
'', $params);
116 if ($manager instanceof \CUserTypeManager)
119 $this->filesUserFieldName => $files,
121 if ($manager->CheckFields($this->filesUserFieldEntityId, $id, $data))
123 return (
bool) $manager->Update($this->filesUserFieldEntityId, $id, $data);
173 array $previouslyMentionedUserIds = []
179 $mentionedUserIds = $parser->getMentionedUserIds($text);
180 $mentionedUserIds = array_filter(
182 static function($userId) use ($fromUserId, $previouslyMentionedUserIds) {
183 $userId = (int)$userId;
185 $userId !== $fromUserId
186 && !in_array($userId, $previouslyMentionedUserIds,
true)
191 if(empty($mentionedUserIds))
196 if(!Loader::includeModule(
'im'))
201 foreach ($mentionedUserIds as $userId)
203 $userId = (int)$userId;
205 $messageIds[] = \CIMNotify::Add([
206 'TO_USER_ID' => $userId,
207 'FROM_USER_ID' => $fromUserId,
208 'NOTIFY_TYPE' => IM_NOTIFY_FROM,
209 'NOTIFY_MODULE' => Driver::MODULE_ID,
210 'NOTIFY_TAG' =>
'RPA|MESSAGE_TIMELINE_MENTION|' . $id,
211 'NOTIFY_MESSAGE' => $message,