Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
        StyleHelper m_refStyle = new StyleHelper();
        CommonApi m_refApi = new CommonApi();
        ApplicationAPI AppUI = new ApplicationAPI();
        if (Request.QueryString["LangType"] == "-1")
        {
            ContentLanguage = AppUI.DefaultContentLanguage;
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            AppUI.ContentLanguage = ContentLanguage;
        }
        else
        {
            AppUI.ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            ContentLanguage = AppUI.ContentLanguage;
        }

        if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"] == "1")
        {
            noWorkAreaString = "&noworkarea=1";
        }
        long mpID = Convert.ToInt64(Request.QueryString["parentid"]);
        long maID = Convert.ToInt64(Request.QueryString["ancestorid"]);

        string AncestorIDParam = "";
        string ParentIDParam = "";
        Collection gtNavs = new Collection();
        if (string.IsNullOrEmpty(Request.QueryString["ancestorid"]))
            AncestorIDParam = "&ancestorid=" + Request.QueryString["ancestorid"];
         if (string.IsNullOrEmpty(Request.QueryString["parentid"]))
            ParentIDParam = "&parentid=" + Request.QueryString["parentid"];

        FolderId = Convert.ToInt64(Request.QueryString["folderid"]);
        MenuId = Convert.ToInt64(Request.QueryString["nId"]);
        string ItemType = Request.Form["ItemType"];

        if (mpID != 0)
        {
            gtNavs = AppUI.EkContentRef.GetMenuByID(mpID, 0, false);
            if (gtNavs.Count > 0)
            {
                if (gtNavs.Contains("EnableReplication"))
                    enableQDOparam = "&qdo=1";
            }
        }
        switch (ItemType)
        {
            case "content":
                Response.Redirect("collections.aspx?action=AddLink&addto=Menu&folderid=" + FolderId + "&nid=" + MenuId + "&LangType=" + ContentLanguage + "&iframe=" + Request.QueryString["iframe"] + AncestorIDParam + ParentIDParam + "&back=" + Server.UrlEncode(Request.QueryString["back"]) + enableQDOparam + noWorkAreaString);
                break;
            case "newcontent":
                Response.Redirect("collectiontree.aspx?action=AddLink&addto=menu&noworkarea=1&nid=" + MenuId + "&folderid=" + FolderId + "&LangType=" + ContentLanguage);
                break;
            case "submenu":
                string enableReplicationFlag = "";
                if ((gtNavs.Count > 0) && (gtNavs.Contains("EnableReplication")))
                    enableReplicationFlag = gtNavs["EnableReplication"].ToString();
                string strPath = "collections.aspx?action=AddSubMenu&folderid=" + FolderId + "&nId=" + MenuId + "&parentid=" + mpID + "&ancestorid=" + maID + "&LangType=" + ContentLanguage + "&iframe=" + Request.QueryString["iframe"] + "&back=" + Server.UrlEncode(Request.QueryString["back"]) + "&QD=" + enableReplicationFlag + noWorkAreaString;
                Response.Redirect(strPath);
                break;
            case "library":
                divLibrary.Visible = true;
                Collection gtFolderInfo = AppUI.EkContentRef.GetFolderInfoWithPath(FolderId);
                FolderPath = gtFolderInfo["Path"].ToString();
           	        if (FolderPath.Substring(FolderPath.Length - 1, 1) == "\\")
                    FolderPath = FolderPath.Remove(FolderPath.Length - 1, 1);
                FolderPath = FolderPath.Replace(@"\", @"\\");
                divLibrary.Visible = true;
                litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("Add Menu Item Title"));
                litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("pAddMenuItem", "") + "</td>";
                if (!string.IsNullOrEmpty(Request.QueryString["back"]))
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
                else if (Request.QueryString["iframe"] == "true")
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true);
                else
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"top.close();\"", StyleHelper.CancelButtonCssClass, true);
                litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt Save Menu Item"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'AddMenuItem\', \'VerifyLibraryAssest()\');\"", StyleHelper.SaveButtonCssClass, true);
            break;
            default:
            divOther.Visible = true;
            litHelp1.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("pAddMenuItem", "") + "</td>";
            litTitle1.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("Add Menu Item Title"));

            if (!string.IsNullOrEmpty(Request.QueryString["back"]))
                litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
            else if (Request.QueryString["iframe"] == "true")
                litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true);
            else
                litButtons1.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"top.close();\"", StyleHelper.CancelButtonCssClass, true);
            litButtons1.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt Save Menu Item"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'AddMenuItem\', \'VerifyAddMenuItem()\');\"", StyleHelper.SaveButtonCssClass, true);
            break;
        }
    }
Beispiel #2
0
    protected void Page_Load(System.Object sender, System.EventArgs e)
    {
        ApplicationAPI AppUI = new ApplicationAPI();
        EkContent cContObj = new EkContent(AppUI.RequestInformationRef);
        taskObj = new EkTask(AppUI.RequestInformationRef);
        long cid;
        string[] tasksArray;
        int lCounter;
        string RefType;
        long CurrentUserID;
        string AppPath;
        string AppImgPath;
        string SitePath;
        string AppeWebPath;
        long CommentKeyId = 0;
        long CommentId = 0;
        string Action;
        object ActionType;
        object IsMac;
        object platform;
        bool Flag;
        object retVal;
        object CommentText;
        object NS4;
        object OrderBy;
        object iMaxContLength;
        object localeFileString;
        object var1;
        object var2;
        string taskIDs;
        object height;
        object width;
        int EnableMultilingual;
        int ContentLanguage;
        Ektron.Cms.Common.EkMessageHelper MsgHelper;
        System.Text.StringBuilder sbScript = new System.Text.StringBuilder();

        MsgHelper = AppUI.EkMsgRef;
        AppPath = AppUI.AppPath;
        AppImgPath = AppUI.AppImgPath;
        SitePath = AppUI.SitePath;
        AppeWebPath = AppUI.AppeWebPath;
        AppPath = AppUI.AppPath;
        AppName = AppUI.AppName;
        EnableMultilingual = AppUI.EnableMultilingual;
        ContentLanguage = 1033; //set default value
        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        if (Convert.ToBoolean(AppUI.RequestInformationRef.IsMembershipUser))
        {
            Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false);
            return;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }

        platform = Request.ServerVariables["HTTP_USER_AGENT"];
        if (platform.ToString().IndexOf("Windows") + 1 > 0)
        {
            IsMac = 0;
        }
        else
        {
            IsMac = 1;
        }

        RefType = "T";
        Flag = false;
        iMaxContLength = 65000;
        localeFileString = "0000";
        var1 = Request.ServerVariables["SERVER_NAME"];
        if (!string.IsNullOrEmpty(Request.QueryString["commentkey_id"]))
        {
            CommentKeyId = Convert.ToInt64(Request.QueryString["commentkey_id"]);
        }
        Action = Request.QueryString["action"];
        ActionType = Request.QueryString["ty"];
        OrderBy = Request.QueryString["orderby"];
        cid = Convert.ToInt64(Request.QueryString["id"]);
        if (!string.IsNullOrEmpty(Request.QueryString["Comment_Id"]))
        {
            CommentId = Convert.ToInt64(Request.QueryString["Comment_Id"]);
        }
        if (!string.IsNullOrEmpty((Request.QueryString["height"])))
        {
            height = Convert.ToDouble(Request.QueryString["height"]);
        }
        if (!string.IsNullOrEmpty((Request.QueryString["width"])))
        {
            width = Convert.ToDouble(Request.QueryString["width"]);
        }
        lCounter = 0;
        CurrentUserID = AppUI.UserId;

        ltrComments.Text = MsgHelper.GetMessage("lbl task comment") + ":";
        if (Request.QueryString["action"] != null && Request.QueryString["action"].ToString().ToLower() == "declinecontentaction")
            ltrComments.Text = MsgHelper.GetMessage("reason to decline");

        cContObj = AppUI.EkContentRef;

        if (Request.ServerVariables["http_user_agent"].ToString().IndexOf("Mozilla") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("4.7") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("GECKO") < 0)
        {
            NS4 = true;
        }
        else
        {
            NS4 = false;
        }

        var2 = cContObj.GetEditorVariablev2_0(0, "tasks");
        ctlEditor.Validate();
        if (Action == "Add" && ctlEditor.IsValid)
        {
            CommentText = this.ctlEditor.Content;
            if (cid != 0)
            {
                //Get all tasks associated with the content and add same comment
                taskObj = AppUI.EkTaskRef;
                object strStates;
                strStates = EkEnumeration.TaskState.NotStarted.ToString() + "," + EkEnumeration.TaskState.Active.ToString() + "," + EkEnumeration.TaskState.AwaitingData.ToString() + "," + EkEnumeration.TaskState.OnHold.ToString() + "," + EkEnumeration.TaskState.Pending.ToString() + "," + EkEnumeration.TaskState.Reopened.ToString();
                taskIDs = taskObj.GetTaskIDs(cid, strStates, -1, (int)EkEnumeration.CMSTaskItemType.TasksByStateAndContentID);

                if (taskIDs != "")
                {
                    tasksArray = Strings.Split(taskIDs.ToString(), ",", -1, 0);
                    while (lCounter <= (tasksArray.Length - 1))
                    {
                        retVal = cContObj.AddComment(Convert.ToInt64(CommentKeyId), Convert.ToInt64(CommentId), Convert.ToInt64(tasksArray.GetValue(lCounter)), RefType, CurrentUserID, Strings.Replace(CommentText.ToString(), "\'", "\'\'", 1, -1, 0));
                        lCounter++;
                    }
                }

            }
            Flag = true;
        }
        if (true == Flag)
        {
            sbScript.Append("<script language=\"JavaScript\" type=\"text/javascript\">" + "\r\n");
            sbScript.Append("<!--");
            sbScript.Append("if (IsBrowserIE())");
            sbScript.Append("{");
            sbScript.Append("   parent.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + \"&id=\" + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );");
            sbScript.Append("}");
            sbScript.Append("else");
            sbScript.Append("{");
            sbScript.Append("   top.opener.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + " + ID == " + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );");
            sbScript.Append("   close();");
            sbScript.Append("}");
            sbScript.Append("//-->");
            sbScript.Append("</script>" + "\r\n");
            ClosePanel.Text = sbScript.ToString();
        }

        if ((Request.QueryString["action"]) == "Add")
        {
            actionName.Value = Request.QueryString["actionName"];
        }
        else
        {
            actionName.Value = Request.QueryString["action"];
        }

        this.ctlEditor.AllowFonts = true;
        ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded");
        ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength));
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
        StyleHelper m_refStyle = new StyleHelper();
        CommonApi m_refApi = new CommonApi();
        ApplicationAPI AppUI = new ApplicationAPI();
        sitePath = AppUI.SitePath;
        AppPath = AppUI.AppPath;
        AxMenuData menuData = new AxMenuData();
        string ErrorString ="";
        MenuId = Convert.ToInt64(Request.QueryString["nid"]);
        FolderId = Convert.ToInt64(Request.QueryString["folderid"]);
        if (Request.QueryString["LangType"] == "-1")
        {
            ContentLanguage = AppUI.DefaultContentLanguage;
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            AppUI.ContentLanguage = ContentLanguage;
        }
        else
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            if (ContentLanguage == 0)
            {
                ContentLanguage = AppUI.DefaultContentLanguage;
                AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                AppUI.ContentLanguage = ContentLanguage;
            }
        }
        Hashtable cPerms = AppUI.EkSiteRef.GetPermissions(FolderId, 0, "folder");
        if (!(IsCollectionMenuRoleMember() || (cPerms.Contains("Collections") && Convert.ToBoolean(cPerms["Collections"]))))
            ErrorString = MsgHelper.GetMessage("com: user does not have permission");

        if (ErrorString == "")
        {
            if (m_refApi.TreeModel == 1)
                gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0,false);
            else
                gtLinks = AppUI.EkContentRef.GetMenuByID(MenuId, 0, true);
            menuData = AppUI.EkContentRef.GetMenuDataByID(MenuId);
            if (!string.IsNullOrEmpty(menuData.AssociatedFolderIdList))
            {
                AssociatedFolderIdListString = menuData.AssociatedFolderIdList;
                AssociatedFolderTitleListString = GetTitlesFromFolderIds(menuData.AssociatedFolderIdList);
            }
            if (!string.IsNullOrEmpty(menuData.AssociatedTemplates))
                AssociatedTemplatesString = menuData.AssociatedTemplates;
        }
        litTitle.Text = m_refStyle.GetTitleBar(MsgHelper.GetMessage("edit menu title"));
        litHelp.Text = StyleHelper.ActionBarDivider + "<td>" + m_refStyle.GetHelpButton("editmenu", "") + "</td>";

        if (Request.QueryString["back"] != "")
            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
        else if (Request.QueryString["iframe"] == "true")
            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true);
        else
        {
            if (m_refApi.TreeModel == 1)
                litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
            else
                litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nid=" + MenuId + "&folderid=" + FolderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
        }

        litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", "Save Menu", MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'menu\', \'VerifyMenuForm()\');\"", StyleHelper.SaveButtonCssClass, true);

        LanguageName = gtLinks["ContentLanguage"].ToString();
    }
Beispiel #4
0
    private void InitEnvironment()
    {
        m_strCmdAction = EkFunctions.HtmlEncode(Request.QueryString["Action"]);
            m_strActionType = EkFunctions.HtmlEncode(Request.QueryString["ty"]);
            m_iCommentKeyId = System.Convert.ToInt64(Request["commentkey_id"]);
            m_iCommentId = System.Convert.ToInt64(Request["Comment_Id"]);
            m_strCommentType = EkFunctions.HtmlEncode(Request["comment_type"]);
            m_strOrderBy = EkFunctions.HtmlEncode(Request["orderby"]);
            m_iRefId = System.Convert.ToInt64(Request["ref_id"]);
            m_strRefType = EkFunctions.HtmlEncode(Request["ref_type"]);
            m_strEditorName = EkFunctions.HtmlEncode(Request["editorName"]);
            m_strAppeWebPath = "";
            m_strLocaleFileString = "0000";
            m_objAppUI = new ApplicationAPI();
            m_objContentObj1 = m_objAppUI.EkContentRef;

            m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath;

            if (Request["LangType"] != "")
            {
                m_iContentLanguage = Convert.ToInt32(Request["LangType"]);
                m_objAppUI.SetCookieValue("LastValidLanguageID", m_iContentLanguage.ToString());
            }
            else
            {
                if (m_objAppUI.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_iContentLanguage = int.Parse(m_objAppUI.GetCookieValue("LastValidLanguageID"));
                }
            }

            m_objAppUI.ContentLanguage = m_iContentLanguage;
            m_objContentObj1 = m_objAppUI.EkContentRef;
            m_iCurrentUserId = m_objAppUI.UserId;
            m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath;
            m_strServerName = Request.ServerVariables["SERVER_NAME"];
            this.Page.Title = m_objAppUI.AppName + " Comments";

            m_strvar2 = m_objContentObj1.GetEditorVariablev2_0(0, "tasks");

            if ((Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("MOZILLA") > -1 && (Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("4.7") > -1 && (!(Strings.UCase(Request.ServerVariables["http_user_agent"]).IndexOf("GECKO") > -1)))
            {
              m_bNS4 = true;
            }
            else
            {
                m_bNS4 = false;
            }
    }
Beispiel #5
0
    protected void Page_Load(System.Object sender, System.EventArgs e)
    {
        ApplicationAPI AppUI = new ApplicationAPI();
        long CurrentUserID;
        EkContent cObj1 =  new EkContent(AppUI.RequestInformationRef);
        Collection cComments;
        object retVal;
        string CommentText;
        string ErrorString = "";
        int iMaxContLength;
        string AppName;
        string AppeWebPath;
        int ContentLanguage;
        int EnableMultilingual;
        string platform;
        object IsMac;

        string AppImgPath = "";
        EkMessageHelper MsgHelper;

        MsgHelper = (new CommonApi()).EkMsgRef;

        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        ltrScript.Text = (new StyleHelper()).GetClientScript();
        if (m_siteRef.RequestInformationRef.IsMembershipUser == 1)
        {
            Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false);
            return;
        }
        ContentLanguage = -1;
        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID").ToString()))
            {
                ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }
        AppUI.ContentLanguage = ContentLanguage;
        m_siteRef.RequestInformationRef.ContentLanguage = ContentLanguage;
        EnableMultilingual = AppUI.EnableMultilingual;
        cObj1 = AppUI.EkContentRef;
        CurrentUserID = AppUI.UserId;
        AppName = AppUI.AppName;
        AppeWebPath = AppUI.AppeWebPath;
        AppImgPath = AppUI.AppImgPath;
        AppPath = AppUI.AppPath;
        RefType = EkFunctions.HtmlEncode(Request["ref_type"]);
        iMaxContLength = 65000;
        if ("" == Request["commentkey_id"])
        {
            CommentKeyId = 0;
        }
        else
        {
            CommentKeyId = Convert.ToInt64(Request["commentkey_id"]);
        }
        Action = EkFunctions.HtmlEncode(Request.QueryString["action"]);
        ActionType = EkFunctions.HtmlEncode(Request.QueryString["ty"]);
        if ("" == Request["Comment_Id"])
        {
            CommentId = 0;
        }
        else
        {
            CommentId = Convert.ToInt64(Request["Comment_Id"]);
        }
        RefId = System.Convert.ToInt64(Request["ref_id"]);
        OrderBy = EkFunctions.HtmlEncode(Request["orderby"]);
        platform = Request.ServerVariables["HTTP_USER_AGENT"];
        if (platform.ToString().IndexOf("Windows") + 1 > 0)
        {
            IsMac = 0;
        }
        else
        {
            IsMac = 1;
        }
        this.Title = AppName + " Comments";
        ltrCancel.Text = MsgHelper.GetMessage("generic cancel");
        if (Action == null || "Add" == Action || "" == Action)
        {
            ltrSubmit.Text = MsgHelper.GetMessage("btn insert");
        }
        else if ("Edit" == Action)
        {
            ltrSubmit.Text = MsgHelper.GetMessage("btn update");
        }

        this.ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded");
        this.ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength));

        CommentText = "";
        if (IsPostBack)
        {
            this.ctlEditor.Validate();
            if (this.ctlEditor.IsValid)
            {
                if (Action == null || "Add" == Action)
                {
                    CommentText = this.ctlEditor.Content;
                    retVal = cObj1.AddComment(CommentKeyId, CommentId, RefId, RefType, CurrentUserID, CommentText);
                    if (ErrorString != "")
                    {
                        Response.Redirect("../reterror.aspx?info=" + ErrorString);
                    }
                }
                else if ("Update" == Action)
                {
                    CommentText = this.ctlEditor.Content;
                    retVal = cObj1.UpdateComment(CommentId, CommentText);
                    if (ErrorString != "")
                    {
                        Response.Redirect("../reterror.aspx?info=" + ErrorString);
                    }
                }
                Response.Write("<script type=\"text/javascript\">" + "\r\n");
                Response.Write("<!--" + "\r\n");
                Response.Write("if (opener != null)" + "\r\n");
                Response.Write("{" + "\r\n");
                Response.Write("window.top.opener.location.href = window.top.opener.location.href;" + "\r\n");
                Response.Write("}" + "\r\n");
                Response.Write("self.close();" + "\r\n");
                Response.Write("//-->" + "\r\n");
                Response.Write("</script>");
            }
        }
        else
        {
            if ("Edit" == Action)
            {
                cComments = cObj1.GetAllComments(CommentKeyId, CommentId, RefId, RefType, CurrentUserID, "");
                if (ErrorString != "")
                {
                    Response.Redirect("../reterror.aspx?info=" + ErrorString);
                }
                for (int i = 1; i <= cComments.Count; i++)
                {
                    Collection coll = (Collection)cComments[i];
                    CommentText = coll["COMMENTS_TEXT"].ToString();
                }

                this.ctlEditor.Content = CommentText.ToString();
            }
        }
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
        ApplicationAPI AppUI = new ApplicationAPI();
        sitePath = AppUI.SitePath;
        if (Request.QueryString["LangType"] == "-1")
        {
            ContentLanguage = AppUI.DefaultContentLanguage;
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            AppUI.ContentLanguage = ContentLanguage;
        }
        else
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            if (ContentLanguage == 0)
            {
                ContentLanguage = AppUI.DefaultContentLanguage;
                AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                AppUI.ContentLanguage = ContentLanguage;
            }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["noworkarea"]) && Request.QueryString["noworkarea"] == "1")
        {
            noWorkAreaString = "&noworkarea=1";
        }

        LanguageData language_data = (new SiteAPI()).GetLanguageById(ContentLanguage);
        if (language_data != null)
            LanguageName = language_data.Name;

        folderId = Convert.ToInt64(Request.QueryString["folderid"]);
        nId = Convert.ToInt64(Request.QueryString["nId"]);

        if (!CanManageMenus)
        {
            Response.Redirect((string)("reterror.aspx?info=" + m_refContentApi.EkMsgRef.GetMessage("msg login menu administrator")), false);
            return;
        }
        action = Request.QueryString["action"];

        switch (action)
        {
            case "AddMenu":
                if (Request.QueryString["back"] != "" && Request.QueryString["back"] != null)
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
                else if (Request.QueryString["bPage"] == "ViewMenuReport")
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenuReport&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
                else
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewAllMenus&folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
                break;
            case "AddSubMenu":
                if (Request.QueryString["back"] != "")
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
                else if (Request.QueryString["iframe"] == "true")
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "#", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "onclick=\"parent.CancelIframe();\"", StyleHelper.CancelButtonCssClass, true);
                else
                {
                    if (Request.QueryString["noworkarea"] == "1")
                        litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", "close.aspx", MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
                    else
                    {
                        if (CommonAPI.TreeModel == 1)
                            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "menutree.aspx?nid=" + nId + "&folderid=" + folderId + "&noworkarea=" + Request.QueryString["noworkarea"], MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
                        else
                            litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?action=ViewMenu&nid=" + nId + "&folderid=" + folderId + "&noworkarea=" + Request.QueryString["noworkarea"], MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
                    }
                }
                break;
            case "AddTransMenu":
                if (Request.QueryString["back"] != "")
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/cancel.png", Request.QueryString["back"], MsgHelper.GetMessage("generic Cancel"), MsgHelper.GetMessage("generic Cancel"), "", StyleHelper.CancelButtonCssClass, true);
                else
                    litButtons.Text = m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/back.png", "collections.aspx?langtype=" + Request.QueryString["backlang"] + "+action=ViewAllMenus+folderid=" + folderId, MsgHelper.GetMessage("alt back button text"), MsgHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true);
                break;
        }

        litButtons.Text += m_refStyle.GetButtonEventsWCaption(AppUI.AppPath + "images/UI/Icons/save.png", "#", MsgHelper.GetMessage("alt save menu"), MsgHelper.GetMessage("btn save"), "onclick=\"return SubmitForm(\'menu\', \'VerifyMenuForm()\');\"", StyleHelper.SaveButtonCssClass, true);
    }