Exemplo n.º 1
0
    private void LogoutUser()
    {
        if (!IsPostBack && m_strAction.ToLower() != "logoutnoprompt")
        {

            LanguageData language_data;
            SiteAPI m_refSiteApi = new SiteAPI();
            language_data = m_refSiteApi.GetLanguageById(m_refSiteApi.UserLanguage);
            //logoutmsg.InnerHtml = m_refMsg.GetMessage("logout message")
            logoutmsg.Text = _ContentApi.AppName + " " + m_refMsg.GetMessage("generic logout msg");
            LogoutPanel.Visible = true;
            //fixed defect # 19069
            System.Text.StringBuilder strCloser = new System.Text.StringBuilder();
            strCloser.AppendLine("<script type=\"text/javascript\">");
            strCloser.AppendLine("document.forms[0].action = \'login.aspx?action=logout&i=19069\';");
            strCloser.AppendLine("</script>");
            Page.ClientScript.RegisterStartupScript(this.GetType(), "formsubmit", strCloser.ToString());
            ltr_olduser.Text = "<input type=\"hidden\" id=\"hdn_olduser\" name=\"hdn_olduser\" value=\"" + m_refUserApi.UserId + "\" />";

        }
        else
        {

            long oldUserId = 0;
            if (!string.IsNullOrEmpty(Request.Form["hdn_olduser"]) && Information.IsNumeric(Request.Form["hdn_olduser"]))
            {
                oldUserId = Convert.ToInt64(Request.Form["hdn_olduser"]);
            }

            if (oldUserId > 0)
            {
                m_refUserApi.clearUserUniqueIdentification(oldUserId);
                if (HttpContext.Current != null && HttpContext.Current.Session != null)
                {
                    HttpContext.Current.Session["ekismembershipuser"] = 0;
                }
            }

            if (m_refUserApi.RequestInformationRef.CommerceSettings.ComplianceMode && oldUserId > 0 && m_refUserApi.EkUserRef.IsUserIdCommerceAdmin(oldUserId))
            {

                Ektron.Cms.Instrumentation.Log.WriteMessage(string.Format(m_refMsg.GetMessage("log commerce auth-commerceadmin logout"), oldUserId), new string[] { "CommerceAuthentication" }, GetLogProperties(oldUserId));

            }

            System.Text.StringBuilder strCloser = new System.Text.StringBuilder();
            // Render script to close the Workarea:
            strCloser.Append("<script type=\"text/javascript\">" + "\r\n");
            strCloser.Append("window.open(\'close.aspx?logout=true\',\'Admin400\',\'toolbar=0,location=0,scrollbars=0,width=1,height=1\');" + "\r\n");
            strCloser.Append("</script>" + "\r\n");
            WorkareaCloserJS.Text = strCloser.ToString();

            if (!(Session["DDSnip"] == null))
            {
                Session["DDSnip"] = null;
            }
            if (!(Session["LibCategory"] == null))
            {
                Session["LibCategory"] = null;
            }
            if (Response.Cookies[System.Web.Security.FormsAuthentication.FormsCookieName] != null)
            {
                Response.Cookies[System.Web.Security.FormsAuthentication.FormsCookieName].Expires = DateTime.Now;
            }

            Response.Cookies["ecm"].Expires = DateTime.Now;
            Response.Cookies["ecmSecure"].Expires = DateTime.Now;
            LoginSuceededPanel.Visible = true;
        }
    }
Exemplo n.º 2
0
    public void DisplayInfo()
    {
        TagData td = new TagData();
            SiteAPI siteApi = new SiteAPI();
            LanguageData langData;
            int language = 0;

            try
            {

                tagLangLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic language");
                tagNameLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic name");

                // If editing an existing tag, show current values:
                if (0 < m_containerPage.TagId)
                {
                    tagIdLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic id") + ":&#160;";
                    td = m_tagApi.GetTagByID(m_containerPage.TagId);
                    if (td != null)
                    {
                        tagIdLit.Text = "<b>" + td.Id.ToString() + "</b><br />";
                        tagNameTxt.Text = td.Text;
                        tagDescTxt.Text = "";
                        tagLangIdHdn.Value = td.LanguageId.ToString();

                        language = td.LanguageId;
                    }
                }
                else
                {
                    language = m_containerPage.ContentLanguage;

                }

                if (language == -1)
                {
                    tagLangLit.Text = m_containerPage.RefMsg.GetMessage("generic all");
                }
                else
                {
                    langData = siteApi.GetLanguageById(language);
                    tagLangLit.Text = langData.Name;
                }

            }
            catch (Exception)
            {
            }
            finally
            {
                td = null;
            }
    }
Exemplo n.º 3
0
    public void DisplayInfo()
    {
        TagData td;
            SiteAPI siteApi = new SiteAPI();
            LanguageData langData;

            try
            {
                tagIdLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic id");
                tagLangLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic language");
                tagNameLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic name");
                tagStatisticsLabel.Text = m_containerPage.RefMsg.GetMessage("lbl tag statistics");

                td = m_tagApi.GetTagByID(m_containerPage.TagId);
                if (td != null)
                {
                    tagNameLit.Text = td.Text;
                    tagIdLit.Text = td.Id.ToString();

                    if (td.LanguageId == -1)
                    {
                        tagLangLit.Text = m_containerPage.RefMsg.GetMessage("generic all");
                    }
                    else
                    {
                        langData = siteApi.GetLanguageById(td.LanguageId);
                        tagLangLit.Text = langData.Name;
                    }

                    tagIdHdn.Value = td.Id.ToString();
                    tagLangIdHdn.Value = td.LanguageId.ToString();

                    SetupStatisticsGrid();
                    tagStatsGrid.DataSource = GetStatisticsTable();
                    tagStatsGrid.DataBind();

                }

            }
            catch (Exception)
            {
            }
            finally
            {
                td = null;
            }
    }
Exemplo n.º 4
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        RegisterResources();

        SiteAPI m_refSiteApi = new SiteAPI();
        m_refMsg = m_refSiteApi.EkMsgRef;
        SettingsData settings_data;
        UserData user_data;
        UserGroupData[] group_data;
        UserPreferenceData preference_data;
        AppImgPath = m_refSiteApi.AppImgPath;
        AppName = m_refSiteApi.AppName;
        SITEPATH = m_refSiteApi.SitePath;
        user_data = m_refUserApi.GetUserById(Ektron.Cms.Common.EkConstants.BuiltIn, false, false);
        preference_data = m_refUserApi.GetUserPreferenceById(0);
        group_data = m_refUserApi.GetAllUserGroups("GroupName");
        VerifyTrue = "<img src=\"" + AppImgPath + "../UI/Icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\">";
        VerifyFalse = "<img src=\"" + AppImgPath + "icon_redx.gif\" border=\"0\" alt=\"Item is Disabled\" title=\"Item is Disabled\">";
        SetStrings();
        settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId, true);
        //VERSION
        td_version.InnerHtml = m_refMsg.GetMessage("version") + "&nbsp;" + m_refSiteApi.Version + "&nbsp;" + m_refSiteApi.ServicePack;
        //BUILD NUMBER
        td_buildnumber.InnerHtml = "<i>(" + m_refMsg.GetMessage("build") + m_refSiteApi.BuildNumber + ")</i>";

        //Which Editor
        m_SelectedEditControl = Utilities.GetEditorPreference(Request);
        if (m_SelectedEditControl == "ContentDesigner")
            tr_wordclass.Visible = true;

        LanguageData language_data;
        language_data = m_refSiteApi.GetLanguageById(m_refSiteApi.DefaultContentLanguage);
        td_Language.InnerHtml = language_data.Name;
        //LICENSE

        if (settings_data.LicenseKey.Length > 0)
        {
            td_licensekey.InnerHtml = settings_data.LicenseKey;
        }
        else
        {
            td_licensekey.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //MODULE LICENSE
        System.Text.StringBuilder module_text = new System.Text.StringBuilder();
        int i = 0;
        if (!(settings_data.ModuleLicense == null))
        {
            for (i = 0; i <= settings_data.ModuleLicense.Length - 1; i++)
            {
                module_text.Append(i + 1 + "." + settings_data.ModuleLicense[i].License);
                module_text.Append("<br/>");
            }
        }
        else
        {
            module_text.Append(m_refMsg.GetMessage("none specified msg"));
        }

        td_modulelicense.InnerHtml = module_text.ToString();
        //LANGUAGE LIST
        LanguageData[] active_lang_list;
        active_lang_list = m_refSiteApi.GetAllActiveLanguages();

        td_languagelist.InnerHtml = m_refMsg.GetMessage("none specified msg");
        if (!(active_lang_list == null))
        {
            for (i = 0; i <= active_lang_list.Length - 1; i++)
            {
                if (Convert.ToString(active_lang_list[i].Id) == settings_data.Language)
                {
                    td_languagelist.InnerHtml = active_lang_list[i].Name;
                    break;
                }
            }
        }

        //MAX CONTENT SIZE

        //td_maxcontent.InnerHtml = settings_data.MaxContentSize

        //MAX SUMMARY SIZE

        //td_maxsummary.InnerHtml = settings_data.MaxSummarySize;

        //SYSTEM EMAIL

        if (settings_data.Email.Length > 0)
        {
            td_email.InnerHtml = settings_data.Email;
        }
        else
        {
            td_email.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //EMAIL NOTIFICATION

        if (settings_data.EnableMessaging)
        {
            td_email_msg.InnerHtml = m_refMsg.GetMessage("sending email enabled msg");
        }
        else
        {
            td_email_msg.InnerHtml = m_refMsg.GetMessage("sending email disabled msg");
        }

        //Server Type
        td_server_type.InnerHtml += GetCheckValue(bool.Parse(settings_data.AsynchronousStaging)) + "&nbsp;" + m_refMsg.GetMessage("lbl enable server type message");

        //Asyncronous Processor Location

        if (!(settings_data.AsynchronousLocation == null) && (settings_data.AsynchronousLocation.Length > 0))
        {
            td_asynch_location.InnerHtml = settings_data.AsynchronousLocation;
        }
        else
        {
            td_asynch_location.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //PUBPDF
        trPublishPDF.Visible = settings_data.PublishPdfSupported;
        td_publish_pdf.InnerHtml += GetCheckValue(settings_data.PublishPdfEnabled) + "&nbsp;" + m_refMsg.GetMessage("alt Enable office documents to be published in other format");

        //LIBRARY FOLDER CREATION
        td_libfolder.InnerHtml = GetCheckValue(settings_data.FileSystemSupport) + "&nbsp;";
        td_libfolder.InnerHtml += m_refMsg.GetMessage("library filesystem folder prompt") + "&nbsp;";

        //BUILT IN USER
        td_user.InnerHtml = user_data.Username;
        //td_removestyle.InnerHtml = GetCheckValue(settings_data.RemoveStyles) & "&nbsp;" & m_refMsg.GetMessage("remove styles")
        td_enablefont.InnerHtml = GetCheckValue(settings_data.EnableFontButtons) + "&nbsp;" + m_refMsg.GetMessage("enable font buttons") + "&nbsp;";
        td_wordstyle.InnerHtml = GetCheckValue(settings_data.PreserveWordStyles) + "&nbsp;" + m_refMsg.GetMessage("preserve word styles");
        td_wordclass.InnerHtml = GetCheckValue(settings_data.PreserveWordClasses) + "&nbsp;" + m_refMsg.GetMessage("preserve word classes");
        td_access.InnerHtml = GetAccessibilityValue(settings_data.Accessibility);

        if (preference_data.Template == "")
        {
            td_template.InnerHtml = m_refMsg.GetMessage("refresh login page msg");
        }
        else
        {
            td_template.InnerHtml = SITEPATH + EkFunctions.HtmlEncode(preference_data.Template);
        }

        td_folder.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (Convert.ToString(preference_data.FolderId) == "")
        {
            td_folder.InnerHtml += " checked ";
        }
        td_folder.InnerHtml += " id=\"checkbox\" name=\"chkSmartDexktop\">";
        td_force.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (preference_data.ForceSetting)
        {
            td_force.InnerHtml += " checked ";
        }
        td_force.InnerHtml += " id=\"Checkbox1\" name=\"forcePrefs\">";
        //td_titletext.InnerHtml = "<input type=\"checkbox\" id=\"disptitletext\" disabled ";
        //if (!string.IsNullOrEmpty(preference_data.DisplayTitleText))
        //{
            //td_titletext.InnerHtml += " checked ";
        //}
        //td_titletext.InnerHtml += "name=\"disptitletext\">";
        //td_height.InnerHtml = preference_data.Height & "px"
        //td_width.InnerHtml = preference_data.Width & "px"

        td_verify_user_on_add.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (settings_data.VerifyUserOnAdd)
        {
            td_verify_user_on_add.InnerHtml += " checked ";
        }
        td_verify_user_on_add.InnerHtml += " id=\"chkVerifyUserOnAdd\" name=\"chkVerifyUserOnAdd\" >";

        td_enable_preapproval.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (settings_data.EnablePreApproval)
        {
            td_enable_preapproval.InnerHtml += " checked ";
        }
        td_enable_preapproval.InnerHtml += " id=\"chkEnablePreapproval\" name=\"chkEnablePreapproval\" >";
    }
Exemplo n.º 5
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);
        }
    }