1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
contentviewhandler.php
См. документацию.
1<?php
2
4
6
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}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static onContentViewed(\Bitrix\Main\Event $event)
Определения contentviewhandler.php:32
Определения event.php:5
Определения loader.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393