Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
blog.php
1
<?php
2
namespace
Bitrix\Landing\Note\Source
;
3
4
use \Bitrix\Socialnetwork\Livefeed\BlogPost;
5
6
class
Blog
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
$post = \CBlogPost::getByID($sourceId);
21
if
(BlogPost::canRead([
'POST'
=> $post]))
22
{
23
$params = [];
24
$blocks = [[
25
'type'
=>
'header'
,
26
'content'
=> $post[
'TITLE'
]
27
]];
28
if
(\
Bitrix
\Main\Loader::includeModule(
'disk'
))
29
{
30
$params = [
31
'files'
=>
self::getDiskFiles
(
32
$sourceId,
33
\
Bitrix
\
Disk
\Uf\BlogPostConnector::class,
34
'blog'
35
)
36
];
37
}
38
$blocks = array_merge(
39
$blocks,
40
Parser::textToBlocks
($post[
'DETAIL_TEXT'
], $params)
41
);
42
return
[
43
'TITLE'
=> \truncateText($post[
'TITLE'
], self::TITLE_LENGTH),
44
'BLOCKS'
=> $blocks
45
];
46
}
47
}
48
49
return
null
;
50
}
51
}
Bitrix\Landing\Connector\Disk
Definition
disk.php:5
Bitrix\Landing\Note\Source\Blog
Definition
blog.php:7
Bitrix\Landing\Note\Source\Blog\getData
static getData(int $sourceId)
Definition
blog.php:13
Bitrix\Landing\Note\Source\Entity
Definition
entity.php:5
Bitrix\Landing\Note\Source\Entity\getDiskFiles
static getDiskFiles(int $sourceId, string $entityType, string $module)
Definition
entity.php:18
Bitrix\Landing\Note\Source\Parser\textToBlocks
static textToBlocks(string $text, array $params=[])
Definition
parser.php:212
Bitrix\Landing\Note\Source
Definition
blog.php:2
Bitrix
modules
landing
lib
note
source
blog.php
Создано системой
1.10.0