public static function closeChatCallback($chat, $operator = false) { $extensions = erConfigClassLhConfig::getInstance()->getSetting('site', 'extensions'); $instance = erLhcoreClassSystem::instance(); foreach ($extensions as $ext) { $callbackFile = $instance->SiteDir . '/extension/' . $ext . '/callbacks/close_chat.php'; if (file_exists($callbackFile)) { include $callbackFile; } } erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.close', array('chat' => &$chat, 'user_data' => $operator)); if (($dep = $chat->department) !== false && $dep->inform_close == 1) { erLhcoreClassChatMail::informChatClosed($chat, $operator); } }