public void Display_Edit() { ContentData content_data; m_reftask = m_reftask.GetTaskByID(m_iID); content_data = m_refContentApi.GetContentById(m_iPostID, 0); security_data = m_refContentApi.LoadPermissions(m_iPostID, "content", 0); if (this.m_iPostID != 0 && this.m_iPostID != -1) { ltr_post_data.Text = "(" + this.m_iPostID.ToString() + ") " + content_data.Title; } base.SetTitleBarToMessage("lbl edit comment"); base.AddBackButton((string)("../content.aspx?action=ViewContentByCategory&id=" + content_data.FolderId.ToString() + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&LangType=" + m_refContentApi.ContentLanguage + "&contentid=" + m_iPostID.ToString())); base.AddButtonwithMessages(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", "alt save comment", "btn save", "OnClick=\"javascript:SubmitForm();return false;\"", StyleHelper.SaveButtonCssClass, true); base.AddHelpButton("EditComment"); SetLabels(); if (m_reftask.State == EkEnumeration.TaskState.Pending.GetHashCode().ToString()) { rb_pending.Checked = true; } else if (m_reftask.State == EkEnumeration.TaskState.Completed.GetHashCode().ToString()) { rb_approved.Checked = true; } txt_displayname.Text = m_reftask.CommentDisplayName; txt_email.Text = m_reftask.CommentEmail; txt_url.Text = m_reftask.CommentURI; txt_comment.Text = m_reftask.Description; RenderJS(); }
protected override void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); m_refContent = new Ektron.Cms.Content.EkContent(m_refContentApi.RequestInformationRef); m_reftask = m_refContentApi.EkTaskRef; Utilities.ValidateUserLogin(); RegisterResources(); if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { m_iPostID = Convert.ToInt64(Request.QueryString["contentid"]); } if (!string.IsNullOrEmpty(Request.QueryString["blogid"])) { m_iBlogID = Convert.ToInt64(Request.QueryString["blogid"]); } if (!string.IsNullOrEmpty(Request.QueryString["close"])) { closeOnFinish = true; } if (Page.IsPostBack) { switch (base.m_sPageAction) { case "add": Process_Add(); break; case "edit": Process_Edit(); break; } } else { switch (base.m_sPageAction) { case "add": Display_Add(); break; case "edit": Display_Edit(); break; } } }
public void Display_Edit() { ContentData content_data; m_reftask = m_reftask.GetTaskByID(m_iID); content_data = m_refContentApi.GetContentById(m_iTopicID, 0); security_data = m_refContentApi.LoadPermissions(m_iTopicID, "content", 0); if (this.m_iTopicID != 0 && this.m_iTopicID != -1) { ltr_topic_data.Text = "(" + this.m_iTopicID.ToString() + ") " + content_data.Title; } if (this.bIsTopic == true) { base.SetTitleBarToMessage("edit topicstarter msg"); } else { base.SetTitleBarToMessage("lbl edit topicreply"); } //If security_data.CanEdit Then base.AddBackButton((string)("../content.aspx?action=ViewContentByCategory&id=" + content_data.FolderId.ToString() + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&LangType=" + m_refContentApi.ContentLanguage + "&contentid=" + m_iTopicID.ToString())); base.AddButtonwithMessages(AppImgPath + "../UI/Icons/save.png", "#", "alt save button text (content)", "btn save", "OnClick=\"javascript:SubmitForm();return false;\"", StyleHelper.SaveButtonCssClass, true); //End If content.aspx?id=77&action=ViewContentByCategory&LangType=1033&ContType=13&contentid=452 base.AddHelpButton("EditReply"); SetLabels(); if (this.bIsTopic == true) { tr_state.Visible = false; } else { if (m_reftask.State == (Convert.ToInt64(EkEnumeration.TaskState.Pending.GetHashCode())).ToString()) { drp_state.SelectedIndex = 0; } else if (m_reftask.State == Convert.ToInt64(EkEnumeration.TaskState.Completed).ToString()) { drp_state.SelectedIndex = 1; } } ltr_created_data.Text = m_reftask.DisplayDateCreated; ltr_created_by_data.Text = m_reftask.CommentDisplayName; if (security_data.CanEdit || m_reftask.CreatedByUserID == m_refContentApi.UserId) { DiscussionBoard board_data = null; Ektron.Cms.Content.EkContent brContent = m_refContentApi.EkContentRef; board_data = brContent.GetTopicbyIDForEdit(m_iTopicID.ToString()); ctlEditor.FolderId = m_iForumID; ctlEditor.SetPermissions(security_data); ctlEditor.AllowFonts = true; if (board_data != null && board_data.StyleSheet.Length > 0) { ctlEditor.Stylesheet = m_refContentApi.SitePath + board_data.StyleSheet; } ctlEditor.Visible = true; ctlEditor.Content = m_reftask.Description; SuppressTitle(); RenderJS(); } else { //txt_topic_title.Enabled = False pnl_message_editor.Controls.Add(new LiteralControl(m_reftask.Description)); } }
private void Process_Edit() { string strContent = (string)ctlEditor.Content; if (m_iBoardID > 0) strContent = this.m_refContentApi.ReplaceWordsForBoardPosts(strContent, m_iBoardID); m_reftask = m_reftask.GetTaskByID(m_iID); if (this.bIsTopic == true) { m_reftask.State = EkEnumeration.TaskState.Completed.ToString(); } else { m_reftask.State = Context.Request.Form[drp_state.UniqueID]; } m_reftask.Description = strContent; m_reftask.ImpersonateUser = true; m_reftask.UpdateTask(); if (closeOnFinish == true) { Response.Redirect("../close.aspx", false); } else { Response.Redirect((string)("../content.aspx?id=" + m_iForumID.ToString() + "&action=ViewContentByCategory&LangType=" + m_refContentApi.RequestInformationRef.ContentLanguage.ToString() + "&ContType=" + Convert.ToInt64(EkEnumeration.TaskType.TopicReply) + "&contentid=" + m_iTopicID.ToString()), false); } }
private void Page_Init(System.Object sender, System.EventArgs e) { m_refContent = new Ektron.Cms.Content.EkContent(m_refContentApi.RequestInformationRef); m_reftask = m_refContentApi.EkTaskRef; ctlEditor = (Ektron.ContentDesignerWithValidator)LoadControl("../controls/Editor/ContentDesignerWithValidator.ascx"); pnl_message_editor.Controls.Add(ctlEditor); ctlEditor.Visible = false; ctlEditor.ID = "content_html"; ctlEditor.ToolsFile = m_refContentApi.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx?EmoticonSelect=1&WMV=1"; }
private void Process_Edit() { m_reftask = m_reftask.GetTaskByID(m_iID); m_reftask.CommentDisplayName = Context.Request.Form[txt_displayname.UniqueID]; m_reftask.CommentEmail = Context.Request.Form[txt_email.UniqueID]; if (Context.Request.Form[txt_url.UniqueID].ToLower() == "http://") { m_reftask.CommentURI = ""; } else { m_reftask.CommentURI = Ektron.Cms.Common.EkFunctions.FixExternalHyperlink(Context.Request.Form[txt_url.UniqueID]); } if (rb_pending.Checked == true) { m_reftask.State = EkEnumeration.TaskState.Pending.ToString(); } else { m_reftask.State = EkEnumeration.TaskState.Completed.ToString(); } m_reftask.Description = Context.Request.Form[txt_comment.UniqueID]; m_reftask.ImpersonateUser = true; m_reftask.UpdateTask(); if (closeOnFinish == true) { Response.Redirect("../close.aspx", false); } else { Response.Redirect((string)("../content.aspx?id=" + m_iBlogID.ToString() + "&action=ViewContentByCategory&LangType=" + ContentLanguage.ToString() + "&ContType=" + EkEnumeration.TaskType.TopicReply.GetHashCode().ToString() + "&contentid=" + m_iPostID.ToString())); } }