Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bind.php
1<?php
3
4class Bind
5{
7 protected static $topicHandler = null;
9 protected static $messageHandler = null;
10
16 public function start()
17 {
18 $eventManager = \Bitrix\Main\EventManager::getInstance();
19
20 \Bitrix\Replica\Client\HandlersManager::register(new ForumMessageAttachmentHandler);
21
22 self::$topicHandler = new TopicHandler;
23 \Bitrix\Replica\Client\HandlersManager::register(self::$topicHandler);
24 $eventManager->addEventHandler("forum", "onAfterTopicAdd", array(self::$topicHandler, "onAfterTopicAdd"));
25 $eventManager->addEventHandler("forum", "onAfterTopicUpdate", array(self::$topicHandler, "onAfterTopicUpdate"));
26 $eventManager->addEventHandler("forum", "onAfterTopicDelete", array(self::$topicHandler, "onAfterTopicDelete"));
27
28 self::$messageHandler = new MessageHandler;
29 \Bitrix\Replica\Client\HandlersManager::register(self::$messageHandler);
30 $eventManager->addEventHandler("forum", "onBeforeMessageAdd", array(self::$messageHandler, "onBeforeMessageAdd"));
31 $eventManager->addEventHandler("forum", "onAfterMessageAdd", array(self::$messageHandler, "onAfterMessageAdd"));
32 $eventManager->addEventHandler("forum", "onBeforeMessageUpdate", array(self::$messageHandler, "onBeforeMessageUpdate"));
33 $eventManager->addEventHandler("forum", "onAfterMessageUpdate", array(self::$messageHandler, "onAfterMessageUpdate"));
34 $eventManager->addEventHandler("forum", "onBeforeMessageDelete", array(self::$messageHandler, "onBeforeMessageDelete"));
35 $eventManager->addEventHandler("forum", "onAfterMessageDelete", array(self::$messageHandler, "onAfterMessageDelete"));
36
37 \Bitrix\Replica\Client\HandlersManager::register(new MessageRatingVoteHandler);
38 }
39}