1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
contentviewhandler.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Blog\Integration\Socialnetwork
;
4
5
use
Bitrix\Main\Loader
;
6
13
final
class
ContentViewHandler
14
{
15
const
CONTENT_TYPE_ID_POST
=
'BLOG_POST'
;
16
const
CONTENT_TYPE_ID_COMMENT
=
'BLOG_COMMENT'
;
17
18
final
public
static
function
getContentTypeIdList
()
19
{
20
return
array
(
21
self::CONTENT_TYPE_ID_POST,
22
self::CONTENT_TYPE_ID_COMMENT
23
);
24
}
25
32
public
static
function
onContentViewed
(\
Bitrix
\
Main
\
Event
$event
)
33
{
34
$userId
= intval(
$event
->getParameter(
'userId'
));
35
$contentTypeId =
$event
->getParameter(
'typeId'
);
36
$contentEntityId = intval(
$event
->getParameter(
'entityId'
));
37
38
if
(
39
$userId
<= 0
40
|| !in_array($contentTypeId, self::getContentTypeIdList())
41
|| $contentEntityId <= 0
42
|| !Loader::includeModule(
'im'
)
43
)
44
{
45
return
false
;
46
}
47
48
$subTagList =
array
();
49
50
if
($contentTypeId == self::CONTENT_TYPE_ID_POST)
51
{
52
$subTagList[] =
"BLOG|POST|"
.$contentEntityId.
'|'
.
$userId
;
53
$subTagList[] =
"BLOG|POST_MENTION|"
.$contentEntityId.
'|'
.
$userId
;
54
}
55
elseif
($contentTypeId == self::CONTENT_TYPE_ID_COMMENT)
56
{
57
$subTagList[] =
"BLOG|COMMENT|"
.$contentEntityId.
'|'
.
$userId
;
58
$subTagList[] =
"BLOG|COMMENT_MENTION|"
.$contentEntityId.
'|'
.
$userId
;
59
}
60
61
if
(!empty($subTagList))
62
{
63
$CIMNotify = new \CIMNotify();
64
$CIMNotify->MarkNotifyReadBySubTag($subTagList);
65
}
66
67
return
true
;
68
}
69
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Blog\Integration\Socialnetwork\ContentViewHandler
Определения
contentviewhandler.php:14
Bitrix\Blog\Integration\Socialnetwork\ContentViewHandler\CONTENT_TYPE_ID_COMMENT
const CONTENT_TYPE_ID_COMMENT
Определения
contentviewhandler.php:16
Bitrix\Blog\Integration\Socialnetwork\ContentViewHandler\onContentViewed
static onContentViewed(\Bitrix\Main\Event $event)
Определения
contentviewhandler.php:32
Bitrix\Blog\Integration\Socialnetwork\ContentViewHandler\CONTENT_TYPE_ID_POST
const CONTENT_TYPE_ID_POST
Определения
contentviewhandler.php:15
Bitrix\Blog\Integration\Socialnetwork\ContentViewHandler\getContentTypeIdList
static getContentTypeIdList()
Определения
contentviewhandler.php:18
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\Loader
Определения
loader.php:13
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\Blog\Integration\Socialnetwork
Определения
contentviewhandler.php:3
Bitrix\Main
Bitrix
$event
$event
Определения
prolog_after.php:141
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
blog
lib
integration
socialnetwork
contentviewhandler.php
Создано системой
1.14.0