/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// of the xml module to edit. /// It then uses the Rainbow.HtmlTextDB() data component /// to populate the page's edit controls with the text details. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, System.EventArgs e) { // Add the setting HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new System.Web.UI.WebControls.Unit(moduleSettings["Height"].ToString()); if (bool.Parse(moduleSettings["ShowMobile"].ToString())) { MobileRow.Visible = true; MobileSummary.Width = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString()); MobileDetails.Width = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString()); } else { MobileRow.Visible = false; } // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) updateButton.CssClass = "CommandButton"; PlaceHolderButtons.Controls.Add(updateButton); PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); cancelButton.CssClass = "CommandButton"; PlaceHolderButtons.Controls.Add(cancelButton); if (Page.IsPostBack == false) { // Obtain a single row of text information HtmlTextDB text = new HtmlTextDB(); // Change by [email protected] - Date: 7/2/2003 // Original: SqlDataReader dr = text.GetHtmlText(ModuleID); SqlDataReader dr = text.GetHtmlText(ModuleID, WorkFlowVersion.Staging); // End Change [email protected] try { if (dr.Read()) { DesktopText.Text = Server.HtmlDecode((string)dr["DesktopHtml"]); MobileSummary.Text = Server.HtmlDecode((string)dr["MobileSummary"]); MobileDetails.Text = Server.HtmlDecode((string)dr["MobileDetails"]); } else { DesktopText.Text = Esperantus.Localize.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); MobileSummary.Text = Esperantus.Localize.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); MobileDetails.Text = Esperantus.Localize.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); } } finally { dr.Close(); } } }
/// <summary> /// The Page_Load event handler on this User Control is used to /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { ViewState["SortField"] = string.Empty; ViewState["SortOrder"] = string.Empty; if (IsEditable) { cmdManage.Visible = true; } else { cmdManage.Visible = false; } } if (Settings["XSLsrc"].ToString().Length > 0 || bool.Parse(Settings["DisplayAsXML"].ToString()) == true) { xmlControl = new UserDefinedTableXML(XmlDataView(), TabID, ModuleIDsrc(), IsEditable, GetSortField(), GetSortOrder()); xmlControl.SortCommand += new UDTXSLSortEventHandler(xmlData_Sort); if (bool.Parse(Settings["DisplayAsXML"].ToString()) == true) { //Show Raw XML xmlText = new TextEditor(); xmlText.Text = xmlControl.InnerXml; xmlText.Width = 450; xmlText.Height = 400; PlaceHolderOutput.Controls.Add((Control)xmlText); } else { //Show XSL data PlaceHolderOutput.Controls.Add(xmlControl); BindXSL(); } } else { //Show datagrid grdData = new DataGrid(); grdData.BorderWidth = 0; grdData.CellPadding = 4; grdData.AutoGenerateColumns = false; grdData.HeaderStyle.CssClass = "NormalBold"; grdData.ItemStyle.CssClass = "Normal"; grdData.AllowSorting = true; grdData.SortCommand += new DataGridSortCommandEventHandler(grdData_Sort); PlaceHolderOutput.Controls.Add(grdData); BindGrid(); } //Rob Siera - 04 nov 2004 - Show ManageButton only when having Permission to edit Properties cmdManage.Visible = ArePropertiesEditable; }
/// <summary> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, System.EventArgs e) { HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new System.Web.UI.WebControls.Unit(moduleSettings["Height"].ToString()); if (!Page.IsPostBack) { if (bool.Parse(moduleSettings["ENHANCEDHTML_GET_CONTENTS_FROM_PORTALS"].ToString())) { kindOfContent.Items.Add(new ListItem("External Module", "Portal")); CustomListDataType cldtAll = new CustomListDataType(new ModulesDB().GetModulesAllPortals(), "ModuleTitle", "ModuleID"); listAllModules.CssClass = "NormalTextBox"; listAllModules.DataSource = cldtAll.DataSource; listAllModules.DataValueField = cldtAll.DataValueField; listAllModules.DataTextField = cldtAll.DataTextField; listAllModules.DataBind(); } CustomListDataType cldt = new CustomListDataType(new ModulesDB().GetModulesSinglePortal(portalSettings.PortalID), "ModuleTitle", "ModuleID"); listModules.CssClass = "NormalTextBox"; listModules.DataSource = cldt.DataSource; listModules.DataValueField = cldt.DataValueField; listModules.DataTextField = cldt.DataTextField; listModules.DataBind(); string comando = Esperantus.Localize.GetString("ENHANCEDHTML_CONFIRMDELETEMESSAGE", "Are You Sure You Wish To Delete This Item ?"); cmdDeletePage.Attributes.Add("onClick", "javascript:return confirm('" + comando + "');"); ViewState["UrlReferrer"] = HttpUrlBuilder.BuildUrl(TabID); CultureInfo[] listaLang = LanguageSwitcher.GetLanguageList(true); lstLanguages.Items.Add(new ListItem(Esperantus.Localize.GetString("ENHANCEDHTML_SHOWALLPAGES", "All Pages"), "0")); foreach (CultureInfo ci in listaLang) { lstLanguages.Items.Add(new ListItem(ci.DisplayName, (ci.LCID).ToString())); listLanguages.Items.Add(new ListItem(ci.DisplayName, (ci.LCID).ToString())); } lstLanguages.SelectedIndex = 0; listLanguages.SelectedIndex = 0; montaLista(); } }
/// <summary> /// Author: Joe Audette /// Created: 1/18/2004 /// Last Modified: 2/5/2004 /// /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the Blog Entry to edit. /// It then uses the Rainbow.BlogDB() data component /// to populate the page's edit controls with the Blog Entry details. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, System.EventArgs e) { // Add the setting HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); // Construct the page DesktopText.Width = new System.Web.UI.WebControls.Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new System.Web.UI.WebControls.Unit(moduleSettings["Height"].ToString()); // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) updateButton.CssClass = "CommandButton"; PlaceHolderButtons.Controls.Add(updateButton); PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); cancelButton.CssClass = "CommandButton"; PlaceHolderButtons.Controls.Add(cancelButton); PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); deleteButton.CssClass = "CommandButton"; PlaceHolderButtons.Controls.Add(deleteButton); // If the page is being requested the first time, determine if an // Blog itemID value is specified, and if so populate page // contents with the Blog details if (Page.IsPostBack == false) { if (ItemID != 0) { BlogDB blogData = new BlogDB(); SqlDataReader dr = blogData.GetSingleBlog(ItemID); try { // Load first row into Datareader if (dr.Read()) { StartField.Text = ((DateTime)dr["StartDate"]).ToString(); TitleField.Text = (string)dr["Title"].ToString(); ExcerptField.Text = (string)dr["Excerpt"].ToString(); DesktopText.Text = Server.HtmlDecode(dr["Description"].ToString()); CreatedBy.Text = (string)dr["CreatedByUser"].ToString(); CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToString(); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown") { CreatedBy.Text = Esperantus.Localize.GetString("UNKNOWN", "unknown"); } } } finally { dr.Close(); } } else { //New article - set defaults StartField.Text = DateTime.Now.ToString(); CreatedBy.Text = PortalSettings.CurrentUser.Identity.Email; CreatedDate.Text = DateTime.Now.ToString(); } } }