Exemple #1
0
    public string Handler_AddTo()
    {
        StringBuilder sbRet = new StringBuilder();
            ContentAPI apiContent = new ContentAPI();
            Ektron.Cms.Community.CommunityGroupAPI apiCommunityGroup = new Ektron.Cms.Community.CommunityGroupAPI();
            Ektron.Cms.Community.FavoritesAPI apiFavorites = new Ektron.Cms.Community.FavoritesAPI();
            Ektron.Cms.Community.FriendsAPI apiFriends = new Ektron.Cms.Community.FriendsAPI();
            long iObjID = 0;
            Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.Content;
            string sMode = "";
            string sMsg = "";
            string sKey = "";
            string sResult = "";
            int iIdx = 0;
            bool bIsMine = false;
            long bIsMyLinkID = 0;
            string sRetMsg = "";
            bool bAuth = false;
            int iLang = 0;
            string title = "";
            string link = "";
            string action = "";
            try
            {
                iObjID = Convert.ToInt64(Request.QueryString["oid"]);
                int oType = 0;
                int.TryParse(EkFunctions.HtmlEncode(Request.QueryString["otype"]), out oType);
                switch (oType)
                {
                    case 0:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.Content;
                        break;
                    case 1:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.User;
                        break;
                    case 19:
                        sbObjType = Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.CommunityGroup;
                        break;
                }

                sMode = EkFunctions.HtmlEncode(Request.QueryString["mode"]);
                sKey = EkFunctions.HtmlEncode(Request.QueryString["key"]);
                iIdx = Convert.ToInt32(Request.QueryString["idx"]);
                title = EkFunctions.HtmlEncode(Request.QueryString["title"]);
                link = EkFunctions.HtmlEncode(Request.QueryString["link"]);

                if (iObjID > 0)
                {
                    sbRet.Append("  <method>AJAX_AddTo</method>").Append(Environment.NewLine);
                }
                else if (iObjID == 0)
                {
                    sbRet.Append("  <method>AJAX_AddLinkTo</method>").Append(Environment.NewLine);
                }

                bAuth = System.Convert.ToBoolean((apiContent.LoadPermissions(0, "users", 0)).IsLoggedIn);
                if (bAuth)
                {
                    if (sbObjType == Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.CommunityGroup)
                    {
                        Ektron.Cms.Common.EkEnumeration.GroupMemberStatus mMemberStatus = Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.NotInGroup;
                        mMemberStatus = apiCommunityGroup.GetGroupMemberStatus(iObjID, apiContent.UserId);
                        if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Approved)
                        {
                            if (sMode == "remove")
                            {
                                apiCommunityGroup.RemoveUserFromCommunityGroup(iObjID, apiContent.UserId);
                                Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl left group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl join group");
                                sResult = "1";
                            }
                            else if (sMode == "add")
                            {
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl already in group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                sResult = "-1";
                            }
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Leader)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl leader of group");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leader of group");
                            sResult = "-1";
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.NotInGroup)
                        {
                            if (sMode == "remove")
                            {
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl not in group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl join group");
                                sResult = "-1";
                            }
                            else if (sMode == "add")
                            {
                                apiCommunityGroup.AddUserToCommunityGroup(iObjID, apiContent.UserId);
                                Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                                mMemberStatus = apiCommunityGroup.GetGroupMemberStatus(iObjID, apiContent.UserId);
                                if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Pending)
                                {
                                    sRetMsg = apiContent.EkMsgRef.GetMessage("lbl cgroup cancel join req");
                                    sMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                    sResult = "0";
                                }
                                else
                                {
                                    sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                    sMsg = apiContent.EkMsgRef.GetMessage("lbl joined group");
                                    sResult = "0";
                                }
                            }
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Pending)
                        {
                            if (sMode == "remove")
                            {
                                apiCommunityGroup.CancelJoinRequestForCommunityGroup(iObjID, apiContent.UserId);
                                Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl cancel group join");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl join group");
                                sResult = "1";
                            }
                            else if (sMode == "add")
                            {
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl requested join group");
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl cgroup cancel join req");
                                sResult = "-1";
                            }
                        }
                        else if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.InvitedMember)
                        {
                            apiCommunityGroup.AddUserToCommunityGroup(iObjID, apiContent.UserId);
                            Ektron.Cms.Common.Cache.ApplicationCache.Invalidate((string) ("GroupAccess_" + iObjID.ToString() + "_" + apiContent.UserId.ToString()));
                            mMemberStatus = apiCommunityGroup.GetGroupMemberStatus(iObjID, apiContent.UserId);
                            if (mMemberStatus == Ektron.Cms.Common.EkEnumeration.GroupMemberStatus.Pending)
                            {
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl cgroup cancel join req");
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                sResult = "0";
                            }
                            else
                            {
                                sRetMsg = apiContent.EkMsgRef.GetMessage("lbl leave group");
                                sMsg = apiContent.EkMsgRef.GetMessage("lbl cgrp accept inv");
                                sResult = "0";
                            }
                        }
                    }
                    else if (sbObjType == Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.Content)
                    {
                        if (Request.QueryString["lang"] != "" && Information.IsNumeric(Request.QueryString["lang"]))
                        {
                            iLang = Convert.ToInt32(Request.QueryString["lang"]);
                        }
                        if (iLang > 0)
                        {
                            apiFavorites.ContentLanguage = iLang;
                        }
                        if (iObjID > 0)
                        {
                            bIsMine = apiFavorites.IsMyContentFavorite(iObjID);
                        }
                        else
                        {
                            bIsMyLinkID = apiFavorites.GetFavoriteId(title, link, apiContent.UserId);
                        }

                        if (sMode == "remove" && bIsMine)
                        {
                            apiFavorites.DeleteMyContentFavorite(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl no longer fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add fav");
                            sResult = "1";
                            action = "addFavorite";
                        }
                        else if (sMode == "remove" && ! bIsMine)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl not fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add fav");
                            sResult = "-1";
                        }
                        else if (sMode == "add" && bIsMine)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl already fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove fav");
                            sResult = "-1";
                        }
                        else if (sMode == "add" && ! bIsMine)
                        {
                            apiFavorites.AddContentFavorite(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl now fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove fav");
                            sResult = "0";
                            action = "removeFavorite";
                        }
                        else if (sMode == "addlink" && bIsMyLinkID == 0)
                        {
                            if (title != "")
                            {
                                apiFavorites.AddFavoriteLink(apiContent.UserId, 0, iLang, title, link, "");
                            }
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl now fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove fav");
                            sResult = "0";
                        }
                        else if (sMode == "addlink" && bIsMyLinkID > 0)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl already fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove fav");
                            sResult = "-1";
                        }
                        else if (sMode == "removelink" && bIsMyLinkID > 0)
                        {
                            apiFavorites.DeleteFavoriteLink(bIsMyLinkID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl no longer fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add fav");
                            sResult = "1";
                        }
                        else if (sMode == "removelink" && bIsMyLinkID == 0)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl not fav");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add fav");
                            sResult = "-1";
                        }
                    }
                    else if (sbObjType == Ektron.Cms.Common.EkEnumeration.CMSSocialBarTypes.User)
                    {
                        Ektron.Cms.Common.EkEnumeration.FriendStatus fFriendStatus = Ektron.Cms.Common.EkEnumeration.FriendStatus.NotFriend;
                        // bIsMine = apiContent.IsMyFriend(iObjID)
                        fFriendStatus = apiFriends.GetFriendStatus(iObjID, apiContent.UserId);
                        if (sMode == "remove" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Approved)
                        {
                            apiFriends.DeleteMyFriend(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl no longer friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add friend");
                            sResult = "1";
                        }
                        else if (sMode == "remove" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.NotFriend)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl not friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add friend");
                            sResult = "-1";
                        }
                        else if (sMode == "add" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Approved)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl already friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove friend");
                            sResult = "-1";
                        }
                        else if (sMode == "add" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.NotFriend)
                        {
                            apiFriends.AddPendingFriend(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl now friend req");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove friend req");
                            sResult = "0";
                        }
                        else if (sMode == "remove" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Pending)
                        {
                            apiFriends.DeletePendingFriendRequest(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl no longer pending friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add friend");
                            sResult = "1";
                        }
                        else if (sMode == "add" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Pending)
                        {
                            apiFriends.AcceptPendingFriend(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl already request friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove friend");
                            sResult = "0";
                        }
                        else if (sMode == "remove" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Invited)
                        {
                            apiFriends.DeleteSentFriendRequest(iObjID);
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl no longer pending friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl add friend");
                            sResult = "1";
                        }
                        else if (sMode == "add" && fFriendStatus == Ektron.Cms.Common.EkEnumeration.FriendStatus.Invited)
                        {
                            sMsg = apiContent.EkMsgRef.GetMessage("lbl already request friend");
                            sRetMsg = apiContent.EkMsgRef.GetMessage("lbl remove friend");
                            sResult = "0";
                        }
                    }
                }
                else
                {
                    sMsg = apiContent.EkMsgRef.GetMessage("lbl not logged in");
                    sRetMsg = apiContent.EkMsgRef.GetMessage("lbl not logged in");
                    sResult = "-1";
                }
                sbRet.Append("  <result>").Append(sResult).Append("</result>").Append(Environment.NewLine);
                sbRet.Append("  <returnmsg>").Append(sMsg).Append("</returnmsg>").Append(Environment.NewLine);
                sbRet.Append("  <oid>").Append(iObjID).Append("</oid>").Append(Environment.NewLine);
                sbRet.Append("  <otype>").Append(oType.ToString()).Append("</otype>").Append(Environment.NewLine);
                sbRet.Append("  <ilang>").Append(iLang.ToString()).Append("</ilang>").Append(Environment.NewLine);
                sbRet.Append("  <idx>").Append(iIdx).Append("</idx>").Append(Environment.NewLine);
                sbRet.Append("  <retmsg>").Append(sRetMsg).Append("</retmsg>").Append(Environment.NewLine);
                sbRet.Append("  <key>").Append(sKey).Append("</key>").Append(Environment.NewLine);
                sbRet.Append("  <action>").Append(action).Append("</action>").Append(Environment.NewLine);
                if (iObjID == 0)
                {
                    sbRet.Append("  <title>").Append(title.ToString()).Append("</title>").Append(Environment.NewLine);
                    sbRet.Append("  <link>").Append(link).Append("</link>").Append(Environment.NewLine);
                }
            }
            catch (Exception ex)
            {
                sbRet.Append("  <method>AJAX_AddTo</method>").Append(Environment.NewLine);
                sbRet.Append("  <result>error</result>").Append(Environment.NewLine);
                sbRet.Append("  <returnmsg>").Append(ex.Message).Append("</returnmsg>").Append(Environment.NewLine);
                sbRet.Append("  <oid>").Append(iObjID).Append("</oid>").Append(Environment.NewLine);
                sbRet.Append("  <otype>").Append(sbObjType).Append("</otype>").Append(Environment.NewLine);
                sbRet.Append("  <ilang>").Append(iLang.ToString()).Append("</ilang>").Append(Environment.NewLine);
                sbRet.Append("  <idx>").Append(iIdx).Append("</idx>").Append(Environment.NewLine);
                sbRet.Append("  <retmsg>").Append(sRetMsg).Append("</retmsg>").Append(Environment.NewLine);
                sbRet.Append("  <key>").Append(sKey).Append("</key>").Append(Environment.NewLine);
            }
            return sbRet.ToString();
    }
Exemple #2
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        bool bAddingNew = false;
        string tempStr;
        string referrerStr;
        try
        {
            //INITIALIZE THE VARIABLES
            if (Request.Browser.Type.IndexOf("IE") != -1)
            {
                IsBrowserIE = true;
            }
            jsIsMac.Text = "false";
            if (Request.Browser.Platform.IndexOf("Win") == -1)
            {
                IsMac = true;
            }
            // Ensure that this is not a browser refresh (Mac-Safari bug causes
            // the editor to load after publishing, if the browser is refreshing):
            if (IsMac && !IsBrowserIE)
            {
                referrerStr = Request.Url.LocalPath;
                if (referrerStr != null)
                {
                    tempStr = referrerStr.Substring(referrerStr.LastIndexOf("/"));
                    if (tempStr == "/workarea.aspx")
                    {
                        tempStr = referrerStr.Replace(tempStr, "/dashboard.aspx");
                        Response.Redirect(tempStr, false);
                        return;
                    }
                }
            }

            if (m_SelectedEditControl != "ContentDesigner")
            {
                m_ctlContentPane.Controls.Remove(m_ctlContentDesigner);
                m_ctlSummaryStandard.Controls.Remove(m_ctlSummaryDesigner);
                m_ctlSummaryRedirect.Controls.Remove(m_ctlFormResponseRedirect);
                m_ctlSummaryTransfer.Controls.Remove(m_ctlFormResponseTransfer);
            }

            Response.Expires = -1;
            Response.AddHeader("Pragma", "no-cache");
            Response.AddHeader("cache-control", "no-store");

            //THE NEXT THREE LINES MUST BE REMOVED BEFORE THE RELEASE
            if (Request.ServerVariables["Query_String"] == "")
            {
                return;
            }

            if (IsMac)
            {
                jsIsMac.Text = "true";
            }

            // Note: To fix a problem with the Ephox Editors on the
            // Mac-running-Safari (assumed if "IsMac and not IsBrowserIE")
            // we need to use different styles for the DIV-tags holding
            // the editors, etc., otherwise they frequently draw themselves
            // when they should remain hidden. These values cause problems
            // with the PC/Win/IE combination, (the summary editor fails to
            // provide a client area for the user to view/edit) so they cannot
            // cannot be used everywhere, hence our use of alternate style classes:
            // Pass class names to javascript:
            jsSelectedDivStyleClass.Text = m_sSelectedDivStyleClass;
            jsUnSelectedDivStyleClass.Text = m_sUnSelectedDivStyleClass;

            m_refContApi = new ContentAPI();
            m_refSiteApi = new SiteAPI();
            m_refContent = m_refContApi.EkContentRef;
            m_refSite = m_refContApi.EkSiteRef;
            m_refTask = m_refContApi.EkTaskRef;

            CurrentUserID = m_refContApi.UserId;
            AppImgPath = m_refContApi.AppImgPath;
            SitePath = m_refContApi.SitePath;
            Appname = m_refContApi.AppName;
            AppeWebPath = m_refContApi.ApplicationPath + m_refContApi.AppeWebPath;
            AppPath = m_refContApi.AppPath;
            EnableMultilingual = m_refContApi.EnableMultilingual;
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            EnhancedMetadataScript.Text = CustomFields.GetEnhancedMetadataScript();
            EnhancedMetadataArea.Text = CustomFields.GetEnhancedMetadataArea();
            lbl_GenericTitleLabel.Text = m_refMsg.GetMessage("generic title label");

            if (!(Request.QueryString["id"] == null))
            {
                m_intItemId = Convert.ToInt64(Request.QueryString["id"]);
                m_intTaxFolderId = m_intItemId;
            }
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
                }
                else
                {
                    if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || m_intContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
            {
                m_intContentLanguage = m_refContApi.DefaultContentLanguage;
            }
            if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContApi.ContentLanguage = m_intContentLanguage;
            }
            if (!String.IsNullOrEmpty(Request.QueryString["folder_id"]))
            {
                m_intFolderId = Convert.ToInt64(Request.QueryString["folder_id"]);
            }

            if (Request.QueryString["form_type"] != null)
            {
                bNewPoll = System.Convert.ToBoolean("poll" == Convert.ToString(Request.QueryString["form_type"]).Trim().ToLower());
            }
            if (Request.QueryString["new"] != null)
            {
                bAddingNew = System.Convert.ToBoolean("true" == Convert.ToString(Request.QueryString["new"]).Trim().ToLower());
            }
            if (Request.QueryString["poll"] != null)
            {
                bReNewPoll = System.Convert.ToBoolean("renew" == Convert.ToString(Request.QueryString["poll"]).Trim().ToLower());
            }
            if (Request.Form["editaction"] != null)
            {
                m_strPageAction = Convert.ToString(Request.Form["editaction"]).ToLower().Trim();
            }
            if (Request.QueryString["translate"] != null)
            {
                translate.Value = "true";
            }
            if (Request.QueryString["type"] != null)
            {
                m_strType = Convert.ToString(Request.QueryString["type"]).ToLower().Trim();
            }
            else if (Request.Form["eType"] != null)
            {
                m_strType = Convert.ToString(Request.Form["eType"]).ToLower().Trim();
            }
            if (!String.IsNullOrEmpty(Request.QueryString["ctlupdateid"]))
            {
                commparams = (string)("&ctlupdateid=" + Request.QueryString["ctlupdateid"] + "&ctlmarkup=" + Request.QueryString["ctlmarkup"] + "&cltid=" + Request.QueryString["cltid"] + "&ctltype=" + Request.QueryString["ctltype"]);
                updateFieldId = Request.QueryString["ctlupdateid"];
                Page.ClientScript.RegisterHiddenField("ctlupdateid", updateFieldId);
            }
            if (!String.IsNullOrEmpty(Request.QueryString["cacheidentifier"]))
            {
                Page.ClientScript.RegisterHiddenField("cacheidentifier", Request.QueryString["cacheidentifier"]);
            }
            else
            {
                if ((Request.QueryString["mycollection"] != null) && (Request.QueryString["addto"] != null) && (Request.QueryString["type"] != null))
                {
                    if (Request.QueryString["type"] == "add" && Request.QueryString["addto"] == "menu")
                    {
                        Page.ClientScript.RegisterHiddenField("cacheidentifier", "menu_" + Request.QueryString["mycollection"] + m_intContentLanguage + "_mnu");
                    }
                }
            }

            //destination.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "processMultiupload.aspx";
            //PostURL.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "processMultiupload.aspx";
            //NextUsing.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "content.aspx";

            if (Request.Cookies[DMSCookieName] != null && !string.IsNullOrEmpty(Request.Cookies[DMSCookieName].Value))
            {

                if (Request.Cookies[DMSCookieName].Value == "2010")
                {
                    Ektron.Cms.Controls.ExplorerDragDrop edd = new Ektron.Cms.Controls.ExplorerDragDrop();
                    edd.ContentLanguage = this.m_intContentLanguage;
                    if (!string.IsNullOrEmpty(Request.QueryString["folderid"]))
                    {
                        destination.Value = edd.GetFolderPath(Int64.Parse(Request.QueryString["folderid"])).Replace(Page.Request.Url.GetLeftPart(UriPartial.Authority), "");
                        putopts.Value = "false";
                    }
                    //btnMUpload.OnClientClick = "return MultipleDocumentUpload(0);";
                    //lbtn_toggleVersion.Attributes.Add("onclick", string.Format(_messageHelper.GetMessage("js office version toggle confirm format"), _messageHelper.GetMessage("li text office 2010 name")));
                }
                else
                {
                    destination.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "processMultiupload.aspx";
                    PostURL.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "processMultiupload.aspx";
                    NextUsing.Value = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + AppPath + "content.aspx";
                    putopts.Value = "true";
                    //btnMUpload.OnClientClick = "return MultipleDocumentUpload(1);";
                    //lbtn_toggleVersion.Attributes.Add("onclick", string.Format(_messageHelper.GetMessage("js office version toggle confirm format"), _messageHelper.GetMessage("li text other office ver name")));

                }
                //tabMultipleDMS.Controls.Add(linebreak);
            }

            if (!String.IsNullOrEmpty(Request.QueryString["ctlmarkup"]))
            {
                Page.ClientScript.RegisterHiddenField("ctlmarkup", Request.QueryString["ctlmarkup"]);
            }
            if (!String.IsNullOrEmpty(Request.QueryString["ctltype"]))
            {
                Page.ClientScript.RegisterHiddenField("ctltype", Request.QueryString["ctltype"]);
            }
            if (!String.IsNullOrEmpty(Request.QueryString["cltid"]))
            {
                Page.ClientScript.RegisterHiddenField("cltid", Request.QueryString["cltid"]);
            }

            if (m_strType == "update")
            {
                m_refContentId = m_intItemId;
            }
            else
            {
                if (!String.IsNullOrEmpty(Request.QueryString["content_id"]))
                {
                    m_refContentId = Convert.ToInt64(Request.QueryString["content_id"]);
                }
            }

            if (Request.QueryString["xid"] != null)
            {
                m_intXmlConfigId = Convert.ToInt64(Request.QueryString["xid"]);
            }
            else if (Request.Form["SelectedXid"] != null)
            {
                m_intXmlConfigId = Convert.ToInt64(Request.Form["SelectedXid"]);
            }
            else
            {
                if (Request.QueryString["type"] == "add")
                {
                    if (Request.QueryString["AllowHTML"] != "1")
                    {
                        m_intXmlConfigId = Utilities.GetDefaultXmlConfig(Convert.ToInt64(Request.QueryString["id"]));
                        if (m_intXmlConfigId == 0)
                        {
                            m_intXmlConfigId = -1;
                        }
                    }
                }
            }
            if (!String.IsNullOrEmpty(Request.QueryString["mycollection"]))
            {
                strMyCollection = Request.QueryString["mycollection"];
            }
            else if (!String.IsNullOrEmpty(Request.Form["mycollection"]))
            {
                strMyCollection = Request.Form["mycollection"];
            }
            if (!String.IsNullOrEmpty(Request.QueryString["addto"]))
            {
                strAddToCollectionType = Request.QueryString["addto"];
            }
            else if (!String.IsNullOrEmpty(Request.Form["addto"]))
            {
                strAddToCollectionType = Request.Form["addto"];
            }
            if (Request.QueryString["close"] == "false")
            {
                m_bClose = false;
            }
            if (Request.QueryString["back_folder_id"] != null)
            {
                back_folder_id = Convert.ToInt64(Request.QueryString["back_folder_id"]);
                m_intTaxFolderId = back_folder_id;
            }
            if (Request.QueryString["back_id"] != null)
            {
                back_id = Convert.ToInt64(Request.QueryString["back_id"]);
            }
            if (Request.QueryString["back_file"] != null)
            {
                back_file = Request.QueryString["back_file"];
            }
            if (Request.QueryString["back_action"] != null)
            {
                back_action = Request.QueryString["back_action"];
                if (back_action.ToLower() == "viewcontentbycategory" || back_action.ToLower() == "viewarchivecontentbycategory")
                {
                    back_folder_id = back_id;
                }
            }
            if (Request.QueryString["control"] != null)
            {
                controlName = Request.QueryString["control"];
            }
            if (Request.QueryString["buttonid"] != null)
            {
                buttonId.Value = Request.QueryString["buttonid"];
            }
            if (Request.QueryString["back_form_id"] != null)
            {
                back_form_id = Convert.ToInt64(Request.QueryString["back_form_id"]);
            }
            if (Request.QueryString["back_LangType"] != null)
            {
                back_LangType = Convert.ToInt32(Request.QueryString["back_LangType"]);
            }
            else
            {
                back_LangType = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]);
            }
            if (Request.QueryString["back_callerpage"] != null)
            {
                back_callerpage = (string)("&back_callerpage=" + Request.QueryString["back_callerpage"]);
            }
            if (Request.QueryString["back_page"] != null)
            {
                back_callerpage = back_callerpage + "&back_page=" + Request.QueryString["back_page"];
            }
            if (Request.QueryString["back_origurl"] != null)
            {
                back_origurl = (string)("&back_origurl=" + EkFunctions.UrlEncode(Request.QueryString["back_origurl"]));
            }
            if (!String.IsNullOrEmpty(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
            {
                if (Ektron.Cms.Common.EkFunctions.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                {
                    g_ContentTypeSelected = System.Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                    m_refContApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, g_ContentTypeSelected.ToString());
                }
            }
            else if (Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
            {
                if (Ektron.Cms.Common.EkFunctions.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                {
                    g_ContentTypeSelected = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                }
            }
            if (Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes == g_ContentTypeSelected)
            {
                if (Request.QueryString["multi"] != null)
                {
                    if ("" == Request.QueryString["multi"])
                    {
                        lContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; //set content type to "content" as default value
                    }
                    else
                    {
                        lContentType = Convert.ToInt32(Request.QueryString["multi"]);
                        if (lContentType == 9876)
                        {
                            lContentType = 103;
                        }
                    }
                }
                else
                {
                    lContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content;
                }
            }
            else
            {
                lContentType = g_ContentTypeSelected;
                if (lContentType == 9876)
                {
                    lContentType = 103;
                }
            }

            language_data = m_refSiteApi.GetLanguageById(m_intContentLanguage);
            if (this.m_strType.ToLower() == "add" && (!String.IsNullOrEmpty(Request.QueryString["SelTaxonomyId"])))
            {
                TaxonomySelectId = Convert.ToInt64(Request.QueryString["SelTaxonomyId"]);
            }
            SettingsData settings_data;
            settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

            int UserLocale;
            UserLocale = m_refSiteApi.RequestInformationRef.UserCulture;
            AppLocaleString = GetLocaleFileString(UserLocale.ToString());
            jsMaxLengthMsg.Text = m_refMsg.GetMessage("js err encoded title exceeds max length");
            jsContentLanguage.Text = Convert.ToString((short)m_intContentLanguage);
            jsId.Text = Convert.ToString(m_intItemId);
            jsDefaultContentLanguage.Text = Convert.ToString(m_refContApi.DefaultContentLanguage);
            jsType.Text = Convert.ToString((short)m_intContentType);
            phAlias.Visible = false;
            Page.Title = m_refContApi.AppName + " " + m_refMsg.GetMessage("edit content page title") + " \"" + Ektron.Cms.CommonApi.GetEcmCookie()["username"] + "\"";
            string editaction = "";
            if (Request.Form["editaction"] != null)
            {
                editaction = Request.Form["editaction"];
            }
            if ("workoffline" == editaction || "cancel" == editaction || ("" == Convert.ToString(m_intItemId) && "" == editaction))
            {
                if (m_strType == "update")
                {
                    ret = m_refContent.UndoCheckOutv2_0(Convert.ToInt64(Request.Form["content_id"]));
                    blnUndoCheckOut_complete = true;
                }
                if (!m_bClose)
                {
                    ClosePanel.Text = "<script language=javascript>" + "\r\n" + "ResizeFrame(1); // Show the navigation-tree frame." + "\r\n" + "</script>";
                    Response.Redirect(GetBackPage(Convert.ToInt64(Request.Form["content_id"])), false);
                }
                else
                {
                    Response.Redirect("close.aspx", false);
                }
            }
            else if ((m_strPageAction == "save") || (m_strPageAction == "checkin") || (m_strPageAction == "publish") || (m_strPageAction == "summary_save") || (m_strPageAction == "meta_save"))
            {
                Process_FormSubmit();
                if (m_bClose && m_strPageAction != "save")
                {
                    if (updateFieldId != "")
                    {
                        string strQuery = "";
                        if (TaxonomySelectId > 0)
                        {
                            strQuery = (string)("&__taxonomyid=" + TaxonomySelectId);
                        }
                        else if (TaxonomyOverrideId > 0)
                        {
                            strQuery = (string)("&__taxonomyid=" + TaxonomyOverrideId);
                        }
                        Response.Redirect((string)("close.aspx?toggle=true" + strQuery), false);
                    }
                }
            }
            else
            {
                Display_EditControls();

                if (!(Page.IsPostBack) && bAddingNew)
                {
                    if (Request.QueryString["form_type"] != null)
                    {
                        newformwizard ucNewFormWizard;
                        ucNewFormWizard = (newformwizard)(LoadControl("controls/forms/newformwizard.ascx"));
                        ucNewFormWizard.ID = "ProgressSteps";
                        phNewFormWizard.Controls.Add(ucNewFormWizard);
                        if (bNewPoll)
                        {
                            PollHtmlScript();
                        }
                    }
                }
            }

            PermissionData cPerms;
            cPerms = m_refContApi.LoadPermissions(m_intContentFolder, "folder", 0);
            m_ctlContentDesigner.FolderId = m_intContentFolder;
            if (2 == m_intContentType)
            {
                m_ctlContentDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.Designer;
            }
            else if (editorPackage.Length > 0)
            {
                m_ctlContentDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.DataEntry;
            }
            else
            {
                m_ctlContentDesigner.ToolsFile = m_refContApi.ApplicationPath + "ContentDesigner/configurations/StandardEdit.aspx?wiki=1";
            }
            m_ctlContentDesigner.SetPermissions(cPerms);
            m_ctlContentDesigner.AllowFonts = true;
            m_ctlSummaryDesigner.FolderId = m_intContentFolder;
            if (2 == m_intContentType)
            {
                m_ctlSummaryDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.XsltDesigner;
            }
            else if (m_bIsBlog)
            {
                m_ctlSummaryDesigner.ToolsFile = m_refContApi.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx?WMV=1";
            }
            else
            {
                m_ctlSummaryDesigner.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.Standard;
            }
            m_ctlSummaryDesigner.SetPermissions(cPerms);
            m_ctlSummaryDesigner.AllowFonts = true;
            m_ctlFormResponseRedirect.FolderId = m_intContentFolder;
            m_ctlFormResponseRedirect.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.NoToolbars;
            m_ctlFormResponseRedirect.SetPermissions(cPerms);
            m_ctlFormResponseRedirect.AllowFonts = true;
            m_ctlFormResponseTransfer.FolderId = m_intContentFolder;
            m_ctlFormResponseTransfer.Toolbars = Ektron.ContentDesignerWithValidator.Configuration.NoToolbars;
            m_ctlFormResponseTransfer.SetPermissions(cPerms);
            m_ctlFormResponseTransfer.AllowFonts = true;
            m_ctlContentValidator.Text = m_refMsg.GetMessage("content size exceeded");
            m_ctlSummaryValidator.Text = m_refMsg.GetMessage("content size exceeded");
            g_ContentTypeSelected = Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes;
            m_refContApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, g_ContentTypeSelected.ToString());
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }