1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
blogcomment.php
См. документацию.
1
<?php
2
namespace
Bitrix\Landing\Note\Source;
3
4
use \Bitrix\Socialnetwork\Livefeed\BlogPost;
5
6
class
BlogComment
extends
Entity
7
{
13
public
static
function
getData
(
int
$sourceId): ?
array
14
{
15
if
(
16
\
Bitrix
\
Main
\Loader::includeModule(
'blog'
) &&
17
\
Bitrix
\
Main
\Loader::includeModule(
'socialnetwork'
)
18
)
19
{
20
$comment
= \CBlogComment::getByID($sourceId);
21
if
(!
$comment
||
$comment
[
'PUBLISH_STATUS'
] !=
BLOG_PUBLISH_STATUS_PUBLISH
)
22
{
23
return
null
;
24
}
25
$post
= \CBlogPost::getByID(
$comment
[
'POST_ID'
]);
26
if
(BlogPost::canRead([
'POST'
=>
$post
]))
27
{
28
$params
= [];
29
$blocks = [[
30
'type'
=>
'header'
,
31
'content'
=>
$post
[
'TITLE'
]
32
]];
33
if
(\
Bitrix
\
Main
\Loader::includeModule(
'disk'
))
34
{
35
$params
= [
36
'files'
=>
self::getDiskFiles
(
37
$sourceId,
38
\
Bitrix
\
Disk
\Uf\BlogPostCommentConnector::class,
39
'blog'
40
)
41
];
42
}
43
$blocks = array_merge(
44
$blocks,
45
Parser::textToBlocks
(
$comment
[
'POST_TEXT'
],
$params
)
46
);
47
return
[
48
'TITLE'
=> \truncateText(
$post
[
'TITLE'
], self::TITLE_LENGTH),
49
'BLOCKS'
=> $blocks
50
];
51
}
52
}
53
54
return
null
;
55
}
56
}
BLOG_PUBLISH_STATUS_PUBLISH
const BLOG_PUBLISH_STATUS_PUBLISH
Определения
include.php:47
Bitrix\Landing\Connector\Disk
Определения
disk.php:5
Bitrix\Landing\Note\Source\BlogComment
Определения
blogcomment.php:7
Bitrix\Landing\Note\Source\BlogComment\getData
static getData(int $sourceId)
Определения
blogcomment.php:13
Bitrix\Landing\Note\Source\Entity
Определения
entity.php:5
Bitrix\Landing\Note\Source\Entity\getDiskFiles
static getDiskFiles(int $sourceId, string $entityType, string $module)
Определения
entity.php:18
Bitrix\Landing\Note\Source\Parser\textToBlocks
static textToBlocks(string $text, array $params=[])
Определения
parser.php:212
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main
Bitrix
$comment
$comment
Определения
template.php:15
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
$post
$post
Определения
template.php:8
bitrix
modules
landing
lib
note
source
blogcomment.php
Создано системой
1.14.0