1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
blogcomment.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Note\Source;
3
4use \Bitrix\Socialnetwork\Livefeed\BlogPost;
5
6class 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,
46 );
47 return [
48 'TITLE' => \truncateText($post['TITLE'], self::TITLE_LENGTH),
49 'BLOCKS' => $blocks
50 ];
51 }
52 }
53
54 return null;
55 }
56}
const BLOG_PUBLISH_STATUS_PUBLISH
Определения include.php:47
static getData(int $sourceId)
Определения blogcomment.php:13
static getDiskFiles(int $sourceId, string $entityType, string $module)
Определения entity.php:18
static textToBlocks(string $text, array $params=[])
Определения parser.php:212
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$comment
Определения template.php:15
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$post
Определения template.php:8