function CreateChatTemplate() { $this->ChatHTML = ""; if (Visitor::$PollCount == 1) { $this->ChatHTML = str_replace("<!--server-->", LIVEZILLA_URL, IOStruct::GetFile(TEMPLATE_HTML_OVERLAY_CHAT)); $this->ChatHTML = str_replace("<!--file_upload_template-->", IOStruct::GetFile(PATH_TEMPLATES . "file_upload.tpl"), $this->ChatHTML); $this->ChatHTML = str_replace("<!--dir-->", LocalizationManager::$Direction, $this->ChatHTML); $this->ChatHTML = getChatLoginInputs($this->ChatHTML, MAX_INPUT_LENGTH_OVERLAY, true); $this->ChatHTML = str_replace("<!--tr_vis-->", strlen(Server::$Configuration->File["gl_otrs"]) > 1 ? "block" : "none", $this->ChatHTML); $this->ChatHTML = str_replace("<!--overlay_input_max_length-->", MAX_INPUT_LENGTH_OVERLAY, $this->ChatHTML); $this->ChatHTML = Server::Replace($this->ChatHTML, true, false); $this->ChatHTML = OverlayChat::ReplaceColors($this->ChatHTML, false); $this->ChatHTML = str_replace("<!--tc-->", Communication::ReadParameter("ovlct", "#ffffff"), $this->ChatHTML); $this->ChatHTML = str_replace("<!--apo-->", !empty($_GET["ovlapo"]) ? "" : "display:none;", $this->ChatHTML); $this->ChatHTML = str_replace("<!--et_vis-->", !empty(Server::$Configuration->File["gl_retr"]) && !empty(Server::$Configuration->File["gl_soct"]) ? "block" : "none", $this->ChatHTML); $this->ChatHTML = str_replace("<!--activate_transcript-->", empty(Server::$Configuration->File["gl_soct"]) ? "" : "CHECKED", $this->ChatHTML); $this->ChatHTML = str_replace("<!--param-->", @Server::$Configuration->File["gl_cpas"], $this->ChatHTML); $tlanguages = getLanguageSelects(LocalizationManager::GetBrowserLocalization()); $this->ChatHTML = str_replace("<!--languages-->", $tlanguages, $this->ChatHTML); } }
$html = str_replace("<!--template_message_extern-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_EXTERN)), $html); $html = str_replace("<!--template_message_add-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD)), $html); $html = str_replace("<!--template_message_add_alt-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE)), $html); $html = str_replace("<!--direct_login-->", parseBool(isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET])), $html); $html = str_replace("<!--is_ie-->", parseBool(!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false), $html); $html = str_replace("<!--setup_error-->", base64_encode(buildLoginErrorField()), $html); $html = str_replace("<!--offline_message_mode-->", $CONFIG["gl_om_mode"], $html); $html = str_replace("<!--offline_message_http-->", $CONFIG["gl_om_http"], $html); $html = str_replace("<!--offline_message_pre_chat-->", parseBool($CONFIG["gl_no_om_sp"] == 1), $html); $html = str_replace("<!--lang_client_queue_message-->", $CONFIG["gl_sho_qu_inf"] == 1 ? $LZLANG["client_queue_message"] : $LZLANG["client_ints_are_busy"], $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.1.0") { initData(true, true, false, false); $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = isset($CONFIG["gl_site_name"]) ? str_replace("<!--config_name-->", $CONFIG["gl_site_name"], $html) : str_replace("<!--config_name-->", "LiveZilla", $html); $html = getChatLoginInputs($html); $html = replaceLoginDetails($html); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--info_text-->", $CONFIG["gl_info"], $html); $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html); $html = str_replace("<!--group_select_visibility-->", defined("HideChatGroupSelection") || count($GROUPS) < 2 ? "display:none;" : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.0.0") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--button_message-->", $CONFIG["gl_no_om_sp"] ? "" : getFile(TEMPLATE_HTML_BUTTON_MESSAGE), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat" && isset($_POST[GET_EXTERN_GROUP])) { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--intgroup-->", base64_encode($_POST[GET_EXTERN_GROUP]), $html); $html = str_replace("<!--misc_frame_height-->", $CONFIG["gl_uret"] && $CONFIG["gl_otrs"] ? 52 : ($CONFIG["gl_uret"] || $CONFIG["gl_otrs"] ? 31 : 0), $html); } else {
$html = str_replace("<!--checkout_only-->", To::BoolString(!empty($_GET["co"]) && !empty($_GET[GET_EXTERN_GROUP])), $html); $html = str_replace("<!--checkout_extend_success-->", To::BoolString(!empty($_GET["co"]) && !empty($_GET["vc"])), $html); $html = str_replace("<!--function_callback-->", To::BoolString(empty(VisitorChat::$DynamicGroup) && (!empty($_GET["cmb"]) || !empty($_GET["ofc"]))), $html); $html = str_replace("<!--function_ticket-->", To::BoolString(empty($_GET["nct"])), $html); $html = str_replace("<!--function_chat-->", To::BoolString(empty($_GET["hfc"])), $html); $html = str_replace("<!--function_knowledgebase-->", To::BoolString(empty($_GET["hfk"]) && !empty(Server::$Configuration->File["gl_knba"])), $html); $html = str_replace("<!--hide_group_select_chat-->", To::BoolString(Communication::GetParameter("hcgs", 0, $nu, FILTER_VALIDATE_INT) == "1" || !empty($_GET[GET_EXTERN_DYNAMIC_GROUP])), $html); $html = str_replace("<!--hide_group_select_ticket-->", To::BoolString(Communication::GetParameter("htgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html); $html = str_replace("<!--require_group_selection-->", To::BoolString(Communication::GetParameter("rgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html); $html = str_replace("<!--offline_message_pop-->", To::BoolString(!empty(Server::$Configuration->File["gl_om_pop_up"]) || empty(Server::$Configuration->File["gl_om_mode"])), $html); $html = str_replace("<!--dynamic_group-->", !empty(VisitorChat::$DynamicGroup) ? base64_encode(Server::$Groups[VisitorChat::$DynamicGroup]->Descriptions["EN"]) : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_lgin") { $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = isset(Server::$Configuration->File["gl_site_name"]) ? str_replace("<!--config_name-->", Server::$Configuration->File["gl_site_name"], $html) : str_replace("<!--config_name-->", "LiveZilla", $html); $html = getChatLoginInputs($html, MAX_INPUT_LENGTH); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--com_chats-->", getChatVoucherTemplate(), $html); $html = str_replace("<!--ssl_secured-->", Communication::GetScheme() == SCHEME_HTTP_SECURE && !empty(Server::$Configuration->File["gl_sssl"]) ? "" : "display:none;", $html); $html = str_replace("<!--bgc-->", $color = Communication::ReadParameter("epc", "#73be28"), $html); $html = str_replace("<!--color-->", Colors::TransformHEX($color, 30), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_chat") { $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $tlanguages = ""; if (strlen(Server::$Configuration->File["gl_otrs"]) > 1) { $mylang = LocalizationManager::GetBrowserLocalization(); $tlanguages = getLanguageSelects(LocalizationManager::GetBrowserLocalization()); } $html = str_replace("<!--languages-->", $tlanguages, $html);
} if ($count == 0) { $BOTMODE = false; $HUMAN = false; $OPERATOR_COUNT = 0; } if (defined("IGNORE_WM") && (empty($USER->Browsers[0]->DesiredChatGroup) || !$HUMAN)) { $USER->AddFunctionCall("lz_chat_set_talk_to_human(false,false);", false); } $ponline = !empty($_GET["ca"]); $conline = $OPERATOR_COUNT > 0; $icw = false; $chat = ""; if (!empty($_GET["pc"]) && $_GET["pc"] == 1) { $chat = str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_HTML_OVERLAY_CHAT)); $chat = getChatLoginInputs($chat, MAX_INPUT_LENGTH_OVERLAY, true); $chat = str_replace("<!--tr_vis-->", strlen($CONFIG["gl_otrs"]) > 1 ? "''" : "none", $chat); $chat = str_replace("<!--overlay_input_max_length-->", MAX_INPUT_LENGTH_OVERLAY, $chat); $chat = applyReplacements($chat, true, false); $chat = str_replace("<!--bgc-->", base64UrlDecode($_GET["ovlc"]), $chat); $chat = str_replace("<!--bgcd-->", hexDarker(str_replace("#", "", base64UrlDecode($_GET["ovlc"])), 50), $chat); $chat = str_replace("<!--tc-->", base64UrlDecode($_GET["ovlct"]), $chat); $chat = str_replace("<!--apo-->", !empty($_GET["ovlapo"]) ? "" : "display:none;", $chat); $chat = str_replace("<!--offer_transcript-->", !empty($CONFIG["gl_soct"]) ? "" : "DISABLED", $chat); $chat = str_replace("<!--activate_transcript-->", empty($CONFIG["gl_soct"]) ? "" : "CHECKED", $chat); $chat = str_replace("<!--param-->", @$CONFIG["gl_cpas"], $chat); $mylang = getBrowserLocalization(); $tlanguages = getLanguageSelects(getBrowserLocalization()); $chat = str_replace("<!--languages-->", $tlanguages, $chat); replaceLoginDetails($USER); }