/// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            onlineUserTemplate = ChatHelper.GetWebpartTransformation(OnlineUserTransformationName, "chat.error.transformation.users.onlineuser"),
            chatRoomWindowUrl  = ChatHelper.GetChatRoomWindowURL(Page),
            clientID           = ClientID,
            GUID            = id,
            contentClientID = pnlChatSearchOnlineUsers.ClientID,
            textbox         = txtChatSearchOnlineUsers.ClientID,
            button          = btnChatSearchOnlineUsers.ClientID,
            pnlPaging       = pnlChatSearchOnlineUsersPaging.ClientID,
            pagingEnabled   = PagingEnabled,
            pagingItems     = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            groupPagesBy    = GroupPagesBy >= 0 ? GroupPagesBy : ChatHelper.WPGroupPagesBy,
            maxUsers        = ResponseMaxUsers,
            inviteMode      = InviteMode,
            loadingDiv      = ChatHelper.GetWebpartLoadingDiv("ChatSearchOnlineUsersWPLoading", "chat.wploading.searchonlineusers"),
            resStrMoreFound = (ResponseMaxUsers > 0) ? String.Format(ResHelper.GetString("chat.searchonlineusers.morefound"), ResponseMaxUsers) : "",
            resStrNotFound  = ResHelper.GetString("chat.searchonlineusers.notfound"),
            pnlInfo         = pnlChatSearchOnlineUsersInfo.ClientID,
            resStrFound     = ResHelper.GetString("chat.searchonlineusers.results"),
            envelopeID      = "envelope_" + ClientID,
            groupID         = GroupName,
            invitePanel     = pnlChatSearchOnlineUsersInvite.ClientID
        }
            );

        return(String.Format("InitChatSearchOnlineUsersWebpart({0});", json));
    }
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            onlineUserTemplate = ChatHelper.GetWebpartTransformation(OnlineUserTransformationName, "chat.error.transformation.users.onlineuser"),
            chatRoomWindowUrl  = ChatHelper.GetChatRoomWindowURL(),
            clientID           = ClientID,
            GUID                  = id,
            contentClientID       = pnlChatOnlineUsers.ClientID,
            inviteMode            = InviteMode,
            pnlFilterClientID     = pnlChatOnlineUsersFiltering.ClientID,
            pnlPagingClientID     = pnlChatOnlineUsersPaging.ClientID,
            pagingItems           = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            pagingEnabled         = EnablePaging,
            btnFilter             = btnChatOnlineUsersFilter.ClientID,
            txtFilter             = txtChatOnlineUsersFilter.ClientID,
            filterEnabled         = EnableFiltering,
            pnlInfo               = pnlChatOnlineUsersInfo.ClientID,
            resStrNoFound         = ResHelper.GetString("chat.onlineusers.notfound"),
            resStrResults         = ResHelper.GetString("chat.onlineusers.results"),
            loadingDiv            = ChatHelper.GetWebpartLoadingDiv("ChatOnlineUsersWPLoading", "chat.wploading.onlineusers"),
            filterCount           = ShowFilterItems >= 0 ? ShowFilterItems : ChatHelper.WPShowFilterLimit,
            envelopeID            = "envelope_" + ClientID,
            resStrNoOneInviteMode = ResHelper.GetString("chat.onlineusers.invitemodenousers"),
            groupID               = GroupName,
            invitePanel           = pnlChatOnlineUsersInvite.ClientID
        }
            );

        return(String.Format("InitChatOnlineUsersWebpart({0});", json));
    }
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        // Set all the transformation settings for chat room window
        int  roomSettingsId = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);
        bool isLiveSite     = ((ViewMode == ViewModeEnum.LiveSite) || (ViewMode == ViewModeEnum.Preview));

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            template                             = ChatHelper.GetWebpartTransformation(NotificationTransformation, "chat.error.transformation.notification"),
            clientID                             = ClientID,
            chatRoomGUID                         = roomSettingsId,
            pnlChatNotificationEmpty             = GetString(pnlChatNotificationEmpty),
            pnlChatNotificationFull              = GetString(pnlChatNotificationFull),
            btnChatNotificationFullLink          = GetString(btnChatNotificationFullLink),
            lblChatNotificationFullTextNumber    = GetString(lblChatNotificationFullTextNumber),
            pnlChatNotificationNotifications     = GetString(pnlChatNotificationNotifications),
            pnlChatNotificationNotificationsList = GetString(pnlChatNotificationNotificationsList),
            btnChatNotificationPromptClose       = GetString(btnChatNotificationPromptClose),
            wpPanelID                            = GetString(pnlWPNotifications),
            envelopeID                           = "#envelope_" + ClientID,
            bubbleBtnShow                        = GetString(btnShow),
            bubbleBtnClose                       = GetString(btnClose),
            bubbleLabel                          = GetString(lblInfoMessage),
            bubblePanel                          = GetString(pnlNotificationInfoBubble),
            strNoNotif                           = ResHelper.GetString("chat.notification.empty"),
            resNewNotif                          = ResHelper.GetString("chat.notification.youhave"),
            bubbleEnabled                        = EnableNotificationBubble && isLiveSite,
            isPreview                            = ViewMode == ViewModeEnum.Preview
        }
            );

        return(String.Format("InitChatNotification({0});", json));
    }
    private void SetWebpartsUp()
    {
        // Load parent webpart settings stored in DB.
        ChatPopupWindowSettingsInfo settings = ChatPopupWindowSettingsHelper.GetPopupWindowSettings(PopupSettingsId);

        // If no settings are stored use default values.
        if (settings == null)
        {
            settings = new ChatPopupWindowSettingsInfo();
            settings.MessageTransformationName    = ChatHelper.TransformationRoomMessages;
            settings.UserTransformationName       = ChatHelper.TransformationRoomUsers;
            settings.ErrorTransformationName      = ChatHelper.TransformationErrors;
            settings.ErrorClearTransformationName = ChatHelper.TransformationErrorsDeleteAll;
        }
        else
        {
            if (string.IsNullOrEmpty(settings.MessageTransformationName))
            {
                settings.MessageTransformationName = ChatHelper.TransformationRoomMessages;
            }
            if (string.IsNullOrEmpty(settings.UserTransformationName))
            {
                settings.UserTransformationName = ChatHelper.TransformationRoomUsers;
            }
            if (string.IsNullOrEmpty(settings.ErrorTransformationName))
            {
                settings.ErrorTransformationName = ChatHelper.TransformationErrors;
            }
            if (string.IsNullOrEmpty(settings.ErrorClearTransformationName))
            {
                settings.ErrorClearTransformationName = ChatHelper.TransformationErrorsDeleteAll;
            }
        }

        // Set errors webpart up.
        ChatErrorsElem.ErrorTransformationName           = settings.ErrorTransformationName;
        ChatErrorsElem.ButtonDeleteAllTransformationName = settings.ErrorClearTransformationName;
        ChatErrorsElem.ShowDeleteAllBtn = true;

        // Set messages webpart up.
        ChatRoomMessagesElem.ChatMessageTransformationName = settings.MessageTransformationName;
        ChatRoomMessagesElem.Direction = ChatRoomMessagesDirectionEnum.Down;
        ChatRoomMessagesElem.Count     = ChatHelper.FirstLoadMessagesCountSetting;

        // Set users webpart up.
        ChatRoomUsersElem.ChatUserTransformationName = settings.UserTransformationName;
        ChatRoomUsersElem.EnablePaging    = true;
        ChatRoomUsersElem.PagingItems     = 5;
        ChatRoomUsersElem.EnableFiltering = true;
        ChatRoomUsersElem.ShowFilterItems = 6;
        ChatRoomUsersElem.SortByStatus    = true;

        // Set send webpart up.
        ChatMessageSendElem.IsSupport  = IsSupport;
        ChatRoomUsersElem.IsSupport    = IsSupport;
        ChatRoomMessagesElem.IsSupport = IsSupport;
        ChatErrorsElem.IsSupport       = IsSupport;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (StopProcessing || !ViewMode.IsOneOf(ViewModeEnum.LiveSite, ViewModeEnum.Preview))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatScriptHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterJQueryCookie(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx");

        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/AutoInitiatedChat_files/AutoInitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        string json = JsonConvert.SerializeObject(
            new
        {
            wpGUID        = InstanceGUID,
            clientID      = pnlInitiatedChat.ClientID,
            contentID     = pnlContent.ClientID,
            pnlErrorID    = pnlError.ClientID,
            lblErrorID    = lblError.ClientID,
            windowURL     = ChatUIHelper.GetChatRoomWindowURL(),
            trans         = ChatUIHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid          = optID,
            delay         = Delay * 1000,
            initiatorName = InitiatorName,
            messages      = MacroResolver.Resolve(Messages).Split('\n')
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );
        string startupScript = string.Format("InitAutoInitiatedChat({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatAutoInitiatedChat_" + ClientID, startupScript, true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!((ViewMode == ViewModeEnum.LiveSite) || (ViewMode == ViewModeEnum.Preview)))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterJQueryCookie(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx", false);

        ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-tmpl.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/AutoInitiatedChat_files/AutoInitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            wpGUID        = InstanceGUID,
            clientID      = pnlInitiatedChat.ClientID,
            contentID     = pnlContent.ClientID,
            pnlErrorID    = pnlError.ClientID,
            lblErrorID    = lblError.ClientID,
            windowURL     = ChatHelper.GetChatRoomWindowURL(),
            trans         = ChatHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid          = optID,
            delay         = Delay * 1000,
            initiatorName = InitiatorName,
            messages      = CMSContext.ResolveMacros(Messages).Split('\n')
        }
            );
        string startupScript = string.Format("InitAutoInitiatedChat({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatAutoInitiatedChat_" + ClientID, startupScript, true);
    }
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        string json = JsonConvert.SerializeObject(
            new
        {
            roomID                        = RoomID,
            chatUserTemplate              = ChatUIHelper.GetWebpartTransformation(ChatUserTransformationName, "chat.error.transformation.users.user"),
            oneToOneURL                   = ChatUIHelper.GetChatRoomWindowURL(Page),
            contentClientID               = pnlChatRoomUsers.ClientID,
            clientID                      = ClientID,
            groupID                       = GroupID,
            sortByStatus                  = SortByStatus,
            GUID                          = id,
            pnlChatRoomUsersInvitePrompt  = pnlChatRoomUsersInvitePrompt.ClientID,
            pnlChatRoomUsersInvite        = pnlChatRoomUsersInvite.ClientID,
            chatOnlineUsersElem           = ChatOnlineUsersElem.ClientID,
            chatSearchOnlineUsersElem     = ChatSearchOnlineUsers.ClientID,
            loadingDiv                    = ChatUIHelper.GetWebpartLoadingDiv("ChatRoomUsersWPLoading", "chat.wploading.roomusers"),
            btnChatRoomUsersInvite        = btnChatRoomUsersInvite.ClientID,
            btnChatRoomsDeletePromptClose = btnChatRoomsDeletePromptClose.ClientID,
            pnlFilterClientID             = pnlChatRoomUsersFiltering.ClientID,
            pnlPagingClientID             = pnlChatRoomUsersPaging.ClientID,
            pagingItems                   = PagingItems > 0 ? PagingItems : ChatSettingsProvider.WPPagingItems,
            groupPagesBy                  = GroupPagesBy >= 0 ? GroupPagesBy : ChatSettingsProvider.WPGroupPagesBy,
            pagingEnabled                 = EnablePaging,
            btnFilter                     = btnChatRoomUsersFilter.ClientID,
            txtFilter                     = txtChatRoomUsersFilter.ClientID,
            filterEnabled                 = EnableFiltering,
            pnlInfo                       = pnlChaRoomUsersInfo.ClientID,
            resStrNoFound                 = ResHelper.GetString("chat.searchonlineusers.notfound"),
            resStrResults                 = ResHelper.GetString("chat.searchonlineusers.results"),
            filterCount                   = ShowFilterItems >= 0 ? ShowFilterItems : ChatSettingsProvider.WPShowFilterLimit,
            envelopeID                    = "envelope_" + ClientID,
            inviteSearchMode              = InviteSearchMode,
            inviteEnabled                 = InviteEnabled
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );

        return(String.Format("InitChatUsersWebpart({0});", json));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!ViewMode.IsOneOf(ViewModeEnum.LiveSite, ViewModeEnum.Preview))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx");

        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/InitiatedChat_files/InitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            clientID   = pnlInitiatedChat.ClientID,
            contentID  = pnlContent.ClientID,
            pnlErrorID = pnlError.ClientID,
            lblErrorID = lblError.ClientID,
            windowURL  = ChatHelper.GetChatRoomWindowURL(),
            trans      = ChatHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid       = optID,
            pingTick   = ChatHelper.GlobalPingIntervalSetting * 1000
        }
            );
        string startupScript = string.Format("InitInitiatedChatManager({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatInitiatedChat_" + ClientID, startupScript, true);
    }
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        // Set all the transformation settings for chat room window
        int  roomSettingsId = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);
        bool isLiveSite     = ViewMode.IsOneOf(ViewModeEnum.LiveSite, ViewModeEnum.Preview);

        string json = JsonConvert.SerializeObject(
            new
        {
            template                             = ChatUIHelper.GetWebpartTransformation(NotificationTransformation, "chat.error.transformation.notification"),
            clientID                             = ClientID,
            chatRoomGUID                         = roomSettingsId,
            pnlChatNotificationEmpty             = GetString(pnlChatNotificationEmpty),
            pnlChatNotificationFull              = GetString(pnlChatNotificationFull),
            btnChatNotificationFullLink          = GetString(btnChatNotificationFullLink),
            lblChatNotificationFullTextNumber    = GetString(lblChatNotificationFullTextNumber),
            pnlChatNotificationNotifications     = GetString(pnlChatNotificationNotifications),
            pnlChatNotificationNotificationsList = GetString(pnlChatNotificationNotificationsList),
            btnChatNotificationPromptClose       = GetString(btnChatNotificationPromptClose),
            wpPanelID                            = GetString(pnlWPNotifications),
            envelopeID                           = "#envelope_" + ClientID,
            bubbleBtnShow                        = GetString(btnShow),
            bubbleBtnClose                       = GetString(btnClose),
            bubbleLabel                          = GetString(lblInfoMessage),
            bubblePanel                          = GetString(pnlNotificationInfoBubble),
            strNoNotif                           = ResHelper.GetString("chat.notification.empty"),
            resNewNotif                          = ResHelper.GetString("chat.notification.youhave"),
            bubbleEnabled                        = EnableNotificationBubble && isLiveSite,
            isPreview                            = ViewMode.IsPreview(),
            notificationManagerOptions           = new
            {
                eventName   = "newnotification",
                soundFile   = ChatSettingsProvider.EnableSoundLiveChat ? ResolveUrl("~/CMSModules/Chat/CMSPages/Sound/Chat_notification.mp3") : String.Empty,
                notifyTitle = ResHelper.GetString("chat.notification.bubble.header")
            }
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );

        return(String.Format("InitChatNotification({0});", json));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatScriptHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Script references insertion

        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatSupportRequest_files/ChatSupportRequest.js");

        // Create and store settings for popup chat window.
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        string json = JsonConvert.SerializeObject(
            new
        {
            onlineUrl            = ChatUIHelper.GetChatRoomWindowURL(),
            clientID             = pnlSupportChatRequest.ClientID,
            guid                 = id,
            trans                = ChatUIHelper.GetWebpartTransformation(string.IsNullOrEmpty(ChatSupportRequestTransformationName) ? ChatSettingsProvider.TransformationSupportRequest : ChatSupportRequestTransformationName, "chat.error.transformation.request"),
            mailEnabled          = ChatSettingsProvider.IsSupportMailEnabledAndValid,
            pnlInformDialog      = "#" + pnlChatSupportRequestInfoDialog.ClientID,
            btnInformDialogClose = "#" + btnChatSupportRequestInformDialogClose.ClientID
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );

        string startupScript = String.Format("ChatSupportRequest({0});", json);

        // Run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "SupportChatRequest_" + ClientID, startupScript, true);
    }
Example #11
0
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        string redirectURL = RedirectURL.Length > 0 ? RedirectURL : ChatHelper.RedirectURLJoinSetting;

        // Set all the transformation settings for chat room window
        int roomSettingsId = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            guid                              = roomSettingsId,
            clientID                          = ClientID,
            groupID                           = GroupID,
            pnlChatRoomsList                  = pnlChatRoomsList.ClientID,
            pnlChatRoomsPrompt                = pnlChatRoomsPrompt.ClientID,
            btnChatRoomsPromptSubmit          = btnChatRoomsPromptSubmit.ClientID,
            pnlChatRoomsCreatePrompt          = pnlChatRoomsCreatePrompt.ClientID,
            txtChatRoomsCreateName            = txtChatRoomsCreateName.ClientID,
            chkChatRoomsCreateIsPrivate       = chkChatRoomsCreateIsPrivate.ClientID,
            txtChatRoomsCreatePassword        = txtChatRoomsCreatePassword.ClientID,
            chkChatRoomsCreateAllowAnonym     = chkChatRoomsCreateAllowAnonym.ClientID,
            btnChatRoomsCreatePromptSubmit    = btnChatRoomsCreatePromptSubmit.ClientID,
            lblChatRoomsCreateError           = lblChatRoomsCreateError.ClientID,
            txtChatRoomsPromptInput           = txtChatRoomsPromptInput.ClientID,
            btnChatRoomsCreateRoom            = btnChatRoomsCreateRoom.ClientID,
            templateListItem                  = ChatHelper.GetWebpartTransformation(ListItemTransformation, "chat.error.transformation.rooms"),
            loadingDiv                        = ChatHelper.GetWebpartLoadingDiv("ChatRoomsWPLoading", "chat.wploading.rooms"),
            txtChatRoomsCreateDescription     = txtChatRoomsCreateDescription.ClientID,
            btnChatRoomsPromptClose           = btnChatRoomsPromptClose.ClientID,
            btnChatRoomsCreatePromptClose     = btnChatRoomsCreatePromptClose.ClientID,
            btnChatRoomsDeletePromptSubmit    = btnChatRoomsDeletePromptSubmit.ClientID,
            btnChatRoomsDeletePromptClose     = btnChatRoomsDeletePromptClose.ClientID,
            pnlChatRoomsDeletePrompt          = pnlChatRoomsDeletePrompt.ClientID,
            btnChatRoomsAbandonPromptSubmit   = btnChatRoomsAbandonPromptSubmit.ClientID,
            btnChatRoomsAbandonPromptClose    = btnChatRoomsAbandonPromptClose.ClientID,
            pnlChatRoomsAbandonPrompt         = pnlChatRoomsAbandonPrompt.ClientID,
            pnlChatRoomsEditPrompt            = pnlChatRoomsEditPrompt.ClientID,
            txtChatRoomsEditName              = txtChatRoomsEditName.ClientID,
            txtChatRoomsEditDescription       = txtChatRoomsEditDescription.ClientID,
            chkChatRoomsEditIsPrivate         = chkChatRoomsEditIsPrivate.ClientID,
            txtChatRoomsEditPassword          = txtChatRoomsEditPassword.ClientID,
            chkChatRoomsEditAllowAnonym       = chkChatRoomsEditAllowAnonym.ClientID,
            btnChatRoomsEditPromptSubmit      = btnChatRoomsEditPromptSubmit.ClientID,
            btnChatRoomsEditPromptClose       = btnChatRoomsEditPromptClose.ClientID,
            txtChatRoomsEditPasswordConfirm   = txtChatRoomsEditPasswordConfirm.ClientID,
            lblChatRoomsEditError             = lblChatRoomsEditError.ClientID,
            passwordTxt                       = ResHelper.GetString("chat.password") + ":",
            passwordNewTxt                    = ResHelper.GetString("chat.passwordnew") + ":",
            lblChatRoomsEditPasswordNew       = lblChatRoomsEditPasswordNew.ClientID,
            txtChatRoomsCreatePasswordConfirm = txtChatRoomsCreatePasswordConfirm.ClientID,
            pnlChatRoomsEditError             = pnlChatRoomsEditError.ClientID,
            chkChatRoomsHasPassword           = chkChatRoomsHasPassword.ClientID,
            pnlChatRoomsCreateError           = pnlChatRoomsCreateError.ClientID,
            pnlFilterClientID                 = pnlChatRoomsFiltering.ClientID,
            pnlPagingClientID                 = pnlChatRoomsPaging.ClientID,
            pagingItems                       = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            pagingEnabled                     = EnablePaging,
            btnFilter                         = btnChatRoomsFilter.ClientID,
            txtFilter                         = txtChatRoomsFilter.ClientID,
            filterEnabled                     = EnableFiltering,
            pnlInfo                           = pnlChatRoomsInfo.ClientID,
            resStrNoFound                     = ResHelper.GetString("chat.rooms.notfound"),
            resStrResults                     = ResHelper.GetString("chat.rooms.results"),
            resStrTooltipPopup                = ResHelper.GetString("chat.enterwithpopup"),
            filterCount                       = ShowFilterItems >= 0 ? ShowFilterItems : ChatHelper.WPShowFilterLimit,
            passwordPromptError               = pnlChatRoomsPromptPasswordError.ClientID,
            redirectURL                       = redirectURL.Length > 0 ? DocumentURLProvider.GetUrl(redirectURL) : "",
            redirectGroup                     = RedirectGroup,
            envelopeID                        = "envelope_" + ClientID,
            pnlErrorCreate                    = pnlChatRoomsCreateErrorConfirm.ClientID,
            pnlErrorEdit                      = pnlChatRoomsEditErrorConfirm.ClientID,
            enablePopup                       = EnablePopup,
            passwordNotMatchStr               = ResHelper.GetString("administration-user_edit_password.passwordsdonotmatch")
        }
            );

        return(String.Format("InitChatRooms({0})", json));
    }