public static function newChatInformWorkflow($options = array(), &$chat) { $chat->nc_cb_executed = 1; $chat->updateThis(); if (in_array('mail', $options['options'])) { erLhcoreClassChatMail::sendMailUnacceptedChat($chat); } if (in_array('xmp', $options['options'])) { erLhcoreClassXMP::sendXMPMessage($chat); } erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.new_chat', array('chat' => &$chat)); // Execute callback if it exists $extensions = erConfigClassLhConfig::getInstance()->getSetting('site', 'extensions'); $instance = erLhcoreClassSystem::instance(); foreach ($extensions as $ext) { $callbackFile = $instance->SiteDir . '/extension/' . $ext . '/callbacks/new_chat.php'; if (file_exists($callbackFile)) { include $callbackFile; } } }