/** * Returns an instance of class (singleton pattern implementation). * * @return EQUESTIONS_CLASS_NotificationBridge */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
private function fullInit() { OW::getRouter()->addRoute(new OW_Route('equestions-index', 'questions', 'EQUESTIONS_CTRL_List', 'all')); OW::getRouter()->addRoute(new OW_Route('equestions-all', 'questions', 'EQUESTIONS_CTRL_List', 'all')); OW::getRouter()->addRoute(new OW_Route('equestions-my', 'questions/my', 'EQUESTIONS_CTRL_List', 'my')); OW::getRouter()->addRoute(new OW_Route('equestions-friends', 'questions/friends', 'EQUESTIONS_CTRL_List', 'friends')); OW::getRouter()->addRoute(new OW_Route('equestions-admin-main', 'admin/plugins/questions', 'EQUESTIONS_CTRL_Admin', 'main')); OW::getRouter()->addRoute(new OW_Route('equestions-question', 'questions/:qid', 'EQUESTIONS_CTRL_Questions', 'question')); $newsfeedBridge = EQUESTIONS_CLASS_NewsfeedBridge::getInstance(); OW::getEventManager()->bind('feed.get_status_update_cmp', array($newsfeedBridge, 'onStatusCmp')); OW::getEventManager()->bind('feed.on_item_render', array($newsfeedBridge, 'onItemRender')); OW::getEventManager()->bind('feed.on_entity_add', array($newsfeedBridge, 'onEntityAdd')); OW::getEventManager()->bind('feed.on_activity', array($newsfeedBridge, 'onActivity')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ANSWER_ADDED, array($newsfeedBridge, 'onAnswerAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ANSWER_REMOVED, array($newsfeedBridge, 'onAnswerRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_FOLLOW_ADDED, array($newsfeedBridge, 'onFollowAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_FOLLOW_REMOVED, array($newsfeedBridge, 'onFollowRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_REMOVED, array($newsfeedBridge, 'onQuestionRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_POST_ADDED, array($newsfeedBridge, 'onPostAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_POST_REMOVED, array($newsfeedBridge, 'onPostRemove')); OW::getEventManager()->bind('feed.collect_configurable_activity', array($newsfeedBridge, 'configurableActivity')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_ASKED, array($newsfeedBridge, 'onAsk')); $activityBridge = EQUESTIONS_CLASS_ActivityBridge::getInstance(); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_ADDED, array($activityBridge, 'onQuestionAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_REMOVED, array($activityBridge, 'onQuestionRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ANSWER_ADDED, array($activityBridge, 'onAnswerAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ANSWER_REMOVED, array($activityBridge, 'onAnswerRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_FOLLOW_ADDED, array($activityBridge, 'onFollowAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_FOLLOW_REMOVED, array($activityBridge, 'onFollowRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_POST_ADDED, array($activityBridge, 'onPostAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_POST_REMOVED, array($activityBridge, 'onPostRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_ASKED, array($activityBridge, 'onAsk')); $commentBridge = EQUESTIONS_CLASS_CommentsBridge::getInstance(); OW::getEventManager()->bind('base_add_comment', array($commentBridge, 'onCommentAdd')); OW::getEventManager()->bind('base_delete_comment', array($commentBridge, 'onCommentRemove')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_REMOVED, array($commentBridge, 'onQuestionRemove')); $groupsBridge = EQUESTIONS_CLASS_GroupsBridge::getInstance(); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_BEFORE_QUESTION_ADDED, array($groupsBridge, 'onBeforeQuestionAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ON_INTERACT_PERMISSION_CHECK, array($groupsBridge, 'onCheckInteractPermission')); EQUESTIONS_CLASS_InvitationsBridge::getInstance()->init(); OW::getEventManager()->bind('admin.add_auth_labels', array($this, 'onAuthLabelsCollect')); OW::getEventManager()->bind(OW_EventManager::ON_FINALIZE, array($this, 'onFinalize')); $creditsBridge = EQUESTIONS_CLASS_CreditsBridge::getInstance(); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_ADDED, array($creditsBridge, 'onQuestionAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_ANSWER_ADDED, array($creditsBridge, 'onAnswerAdd')); //OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_FOLLOW_ADDED, array($creditsBridge, 'onFollowAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_POST_ADDED, array($creditsBridge, 'onPostAdd')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_QUESTION_ASKED, array($creditsBridge, 'onAsk')); OW::getEventManager()->bind(EQUESTIONS_BOL_Service::EVENT_OPTION_ADDED, array($creditsBridge, 'onOptionAdd')); EQUESTIONS_CLASS_EnotificationBridge::getInstance()->init(); //Privacy OW::getEventManager()->bind('plugin.privacy.get_action_list', array($this, 'collectPrivacyActions')); OW::getEventManager()->bind('feed.collect_privacy', array($newsfeedBridge, 'collectPrivacy')); OW::getEventManager()->bind('plugin.privacy.on_change_action_privacy', array($this, 'onPrivacyChange')); $credits = new EQUESTIONS_CLASS_Credits(); OW::getEventManager()->bind('usercredits.on_action_collect', array($credits, 'bindCreditActionsCollect')); }