1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
logcomment.php
См. документацию.
1
<?php
8
namespace
Bitrix\Blog\Integration\Socialnetwork;
9
10
use Bitrix\Main\Event;
11
use Bitrix\Main\EventResult;
12
use Bitrix\Blog\Item\Comment;
13
use Bitrix\Main\Loader;
14
use Bitrix\Socialnetwork\CommentAux;
15
use Bitrix\Socialnetwork\Item\LogIndex;
16
17
class
LogComment
18
{
19
const
EVENT_ID_COMMENT
=
'blog_comment'
;
20
21
public
static
function
getEventIdList
()
22
{
23
return
array
(
24
self::EVENT_ID_COMMENT
25
);
26
}
27
34
public
static
function
onIndexGetContent
(
Event
$event
)
35
{
36
$result
=
new
EventResult
(
37
EventResult::UNDEFINED,
38
array
(),
39
'blog'
40
);
41
42
$eventId =
$event
->getParameter(
'eventId'
);
43
$sourceId =
$event
->getParameter(
'sourceId'
);
44
45
if
(!in_array($eventId, self::getEventIdList()))
46
{
47
return
$result
;
48
}
49
50
$content
=
""
;
51
$comment
=
false
;
52
53
if
(intval($sourceId) > 0)
54
{
55
$comment
=
Comment::getById
($sourceId);
56
}
57
58
if
(
$comment
)
59
{
60
$commentFieldList =
$comment
->getFields();
61
62
if
(!($commentAuxProvider =
CommentAux
\Base::findProvider($commentFieldList)))
63
{
64
$content
.= LogIndex::getUserName($commentFieldList[
"AUTHOR_ID"
]).
" "
;
65
$content
.=
\blogTextParser::killAllTags
($commentFieldList[
"POST_TEXT"
]);
66
}
67
68
if
(!empty($commentFieldList[
'UF_BLOG_COMMENT_FILE'
]))
69
{
70
$fileNameList = LogIndex::getDiskUFFileNameList($commentFieldList[
'UF_BLOG_COMMENT_FILE'
]);
71
if
(!empty($fileNameList))
72
{
73
$content
.=
' '
.join(
' '
, $fileNameList);
74
}
75
}
76
77
if
(!empty($commentFieldList[
'UF_BLOG_COMM_URL_PRV'
]))
78
{
79
$metadata =
\Bitrix\Main\UrlPreview\UrlMetadataTable::getRowById
($commentFieldList[
'UF_BLOG_COMM_URL_PRV'
]);
80
if
(
81
$metadata
82
&& isset($metadata[
'TITLE'
])
83
&& $metadata[
'TITLE'
] <>
''
84
)
85
{
86
$content
.=
' '
.$metadata[
'TITLE'
];
87
}
88
}
89
}
90
91
$result
=
new
EventResult
(
92
EventResult::SUCCESS,
93
array
(
94
'content'
=>
$content
,
95
),
96
'blog'
97
);
98
99
return
$result
;
100
}
101
}
102
Bitrix\Blog\Integration\Socialnetwork\LogComment
Определения
logcomment.php:18
Bitrix\Blog\Integration\Socialnetwork\LogComment\EVENT_ID_COMMENT
const EVENT_ID_COMMENT
Определения
logcomment.php:19
Bitrix\Blog\Integration\Socialnetwork\LogComment\onIndexGetContent
static onIndexGetContent(Event $event)
Определения
logcomment.php:34
Bitrix\Blog\Integration\Socialnetwork\LogComment\getEventIdList
static getEventIdList()
Определения
logcomment.php:21
Bitrix\Blog\Item\Comment\getById
static getById($commentId=0)
Определения
comment.php:25
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\EventResult
Определения
eventresult.php:5
Bitrix\Main\ORM\Data\DataManager\getRowById
static getRowById($id, array $parameters=[])
Определения
datamanager.php:380
blogTextParser\killAllTags
static killAllTags($text)
Определения
functions.php:473
$content
$content
Определения
commerceml.php:144
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Socialnetwork\CommentAux
Определения
base.php:3
$event
$event
Определения
prolog_after.php:141
$comment
$comment
Определения
template.php:15
bitrix
modules
blog
lib
integration
socialnetwork
logcomment.php
Создано системой
1.14.0