/// <summary> /// Raises OnInitEvent /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> protected override void OnInit(EventArgs e) { var editor = ModuleSettings["Editor"].ToString(); var width = this.ModuleSettings["Width"].ToString(); var height = this.ModuleSettings["Height"].ToString(); var showUpload = this.ModuleSettings["ShowUpload"].ToBoolean(CultureInfo.InvariantCulture); var h = new HtmlEditorDataType { Value = editor }; this.DesktopText = h.GetEditor( this.PlaceHolderComponentEditor, this.ModuleID, showUpload, this.PortalSettings); this.DesktopText.Width = new Unit(width); this.DesktopText.Height = new Unit(height); //Translate // Added EsperantusKeys for Localization // Mario Endara [email protected] june-1-2004 RequiredTitle.ErrorMessage = General.GetString("ERROR_VALID_TITLE"); //RequiredComponent.ErrorMessage = General.GetString("ERROR_VALID_DESCRIPTION"); this.Load += new EventHandler(this.Page_Load); this.UpdateButton.Click += new EventHandler(updateButton_Click); base.OnInit(e); }
/// <summary> /// FAQs constructor added 10/27/03 by Chris Farrell, [email protected] /// </summary> public FAQs() { // Set Editor Settings [email protected] 2004/07/30 HtmlEditorDataType.HtmlEditorSettings(_baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); SupportsWorkflow = false; }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); _to = new EmailAddressList(); _cc = new EmailAddressList(); _bcc = new EmailAddressList(); HtmlEditorDataType h = new HtmlEditorDataType(); PortalSettings pS = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; try { h.Value = pS.CustomSettings["SITESETTINGS_DEFAULT_EDITOR"].ToString(); txtBody = h.GetEditor(PlaceHolderHTMLEditor, int.Parse(Context.Request["mID"]), bool.Parse(pS.CustomSettings["SITESETTINGS_SHOWUPLOAD"].ToString()), pS); } catch { txtBody = h.GetEditor(PlaceHolderHTMLEditor, int.Parse(Context.Request["mID"]), true, pS); } lblEmailAddressesNotOk.Text = General.GetString("EMF_ADDRESSES_NOT_OK", "The emailaddresses are not ok.", lblEmailAddressesNotOk); }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event. /// </summary> /// <param name="e"> /// An <see cref="T:System.EventArgs"/> object that contains the event data. /// </param> protected override void OnInit(EventArgs e) { this.To = new EmailAddressList(); this.Cc = new EmailAddressList(); this.Bcc = new EmailAddressList(); var h = new HtmlEditorDataType(); var pS = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; try { h.Value = pS.CustomSettings["SITESETTINGS_DEFAULT_EDITOR"].ToString(); this.txtBody = h.GetEditor( this.PlaceHolderHTMLEditor, int.Parse(this.Context.Request["mID"]), bool.Parse(pS.CustomSettings["SITESETTINGS_SHOWUPLOAD"].ToString()), pS); } catch { this.txtBody = h.GetEditor(this.PlaceHolderHTMLEditor, int.Parse(this.Context.Request["mID"]), true, pS); } this.lblEmailAddressesNotOk.Text = General.GetString( "EMF_ADDRESSES_NOT_OK", "The emailaddresses are not ok.", this.lblEmailAddressesNotOk); this.txtTo.Text = string.Join(";", (string[])this.To.ToArray(typeof(string))); this.txtCc.Text = string.Join(";", (string[])this.Cc.ToArray(typeof(string))); this.txtBcc.Text = string.Join(";", (string[])this.Bcc.ToArray(typeof(string))); base.OnInit(e); }
/// <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">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, 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 Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new Unit(moduleSettings["Height"].ToString()); if (bool.Parse(moduleSettings["ShowMobile"].ToString())) { MobileRow.Visible = true; MobileSummary.Width = new Unit(moduleSettings["Width"].ToString()); MobileDetails.Width = new 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 = General.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); MobileSummary.Text = General.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); MobileDetails.Text = General.GetString("HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); } } finally { dr.Close(); } } }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public Events() { // Set Editor Settings [email protected] 2004/07/30 (added by Jakob Hansen) HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); //Indah Fuldner SettingItem RepeatDirection = new SettingItem(new ListDataType("Vertical;Horizontal")); RepeatDirection.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatDirection.Required = true; RepeatDirection.Value = "Vertical"; RepeatDirection.Order = 10; this._baseSettings.Add("RepeatDirectionSetting", RepeatDirection); SettingItem RepeatColumn = new SettingItem(new IntegerDataType()); RepeatColumn.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatColumn.Required = true; RepeatColumn.Value = "1"; RepeatColumn.MinValue = 1; RepeatColumn.MaxValue = 10; RepeatColumn.Order = 20; this._baseSettings.Add("RepeatColumns", RepeatColumn); SettingItem showItemBorder = new SettingItem(new BooleanDataType()); showItemBorder.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; showItemBorder.Order = 30; showItemBorder.Value = "false"; this._baseSettings.Add("ShowBorder", showItemBorder); //End Indah Fuldner SettingItem DelayExpire = new SettingItem(new IntegerDataType()); DelayExpire.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; DelayExpire.Order = 40; DelayExpire.Value = "365"; // 1 year DelayExpire.MinValue = 0; DelayExpire.MaxValue = 3650; //10 years this._baseSettings.Add("DelayExpire", DelayExpire); // devsolution 2003/6/17: Added items for calendar control // Show Calendar - Show a visual calendar with // Default is false for backward compatibility // Must edit collection properties and set to true // to show calendar SettingItem ShowCalendar = new SettingItem(new BooleanDataType()); ShowCalendar.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; ShowCalendar.Order = 50; ShowCalendar.Value = "false"; this._baseSettings.Add("ShowCalendar", ShowCalendar); // devsolution 2003/6/17: Finished - Added items for calendar control // Change by [email protected] // Date: 27/2/2003 SupportsWorkflow = true; // End Change [email protected] }
/// <summary> /// Handles OnInit event /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> /// <remarks> /// The Page_Load event on this Page is used to obtain the ModuleID /// of the xml module to edit. /// It then uses the Appleseed.HtmlTextDB() data component /// to populate the page's edit controls with the text details. /// </remarks> protected override void OnInit(EventArgs e) { // Controls must be created here this.UpdateButton = new LinkButton(); this.CancelButton = new LinkButton(); // Add the setting var editor = this.ModuleSettings["Editor"].ToString(); var width = this.ModuleSettings["Width"].ToString(); var height = this.ModuleSettings["Height"].ToString(); var showUpload = this.ModuleSettings["ShowUpload"].ToBoolean(CultureInfo.InvariantCulture); var h = new HtmlEditorDataType { Value = editor }; this.DesktopText = h.GetEditor( this.PlaceHolderHTMLEditor, this.ModuleID, showUpload, this.PortalSettings); this.DesktopText.Width = new Unit(width); this.DesktopText.Height = new Unit(height); // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) this.UpdateButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.UpdateButton); this.PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); this.CancelButton.CssClass = "CommandButton"; this.CancelButton.ID = "EditHtmlCancelButton"; this.PlaceHolderButtons.Controls.Add(this.CancelButton); // Obtain a single row of text information var text = new HtmlTextDB(); // Change by [email protected] - Date: 7/2/2003 // Original: SqlDataReader dr = text.GetHtmlText(ModuleID); var dr = text.GetHtmlText(this.ModuleID, WorkFlowVersion.Staging); // End Change [email protected] try { if (dr.Read()) { this.DesktopText.Text = this.Server.HtmlDecode((string)dr["DesktopHtml"]); } else { this.DesktopText.Text = General.GetString( "HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); } } finally { dr.Close(); } this.dialogclass.Attributes.Add("class", this.ModuleID.ToString()); base.OnInit(e); }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public Tasks() { // Set Editor Settings [email protected] 2004/07/30 HtmlEditorDataType.HtmlEditorSettings(_baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); SettingItem setSortField = new SettingItem(new ListDataType("Title;Status;Priority;DueDate;AssignedTo;PercentComplete")); setSortField.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; setSortField.Required = true; setSortField.Value = "DueDate"; _baseSettings.Add("TASKS_SORT_FIELD", setSortField); SettingItem defaultAssignee = new SettingItem(new StringDataType()); defaultAssignee.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; defaultAssignee.Value = "nobody"; defaultAssignee.EnglishName = "Default Assignee"; defaultAssignee.Description = "Is the name of the person which the task is automatically assigned."; _baseSettings.Add("TASKS_DEFAULT_ASSIGNEE", defaultAssignee); // Task modules list ModulesDB m = new ModulesDB(); ArrayList taskModulesListOptions = new ArrayList(); SqlDataReader r = null; try { r = m.GetModulesByName("Tasks", portalSettings.PortalID); while (r.Read()) { taskModulesListOptions.Add( new SettingOption(int.Parse(r["ModuleID"].ToString()), r["ModuleTitle"].ToString())); } } catch //install time { } finally { if (r != null && r.IsClosed == false) { r.Close(); } } SettingItem linkedModules = new SettingItem(new MultiSelectListDataType(taskModulesListOptions, "Name", "Val")); linkedModules.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; linkedModules.Value = "0"; linkedModules.EnglishName = "Linked Modules"; linkedModules.Description = "Chose here any module that will automatically recieve a copy of all new assigned task."; _baseSettings.Add("TASKS_LINKED_MODULES", linkedModules); }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public Discussion() { // Jminond - added editor support HtmlEditorDataType.HtmlEditorSettings(_baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); /* * SettingItem setSortField = new SettingItem(new ListDataType("CreatedDate;Title")); * setSortField.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; * setSortField.Required = true; * setSortField.Value = "DueDate"; * this._baseSettings.Add("DISCUSSION_SORT_FIELD", setSortField); */ }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, 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 Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new 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 = General.GetString("ENHANCEDHTML_CONFIRMDELETEMESSAGE", "Are You Sure You Wish To Delete This Item ?"); cmdDeletePage.Attributes.Add("onClick", "javascript:return confirm('" + comando + "');"); ViewState["UrlReferrer"] = HttpUrlBuilder.BuildUrl(PageID); CultureInfo[] listaLang = LanguageSwitcher.GetLanguageList(true); lstLanguages.Items.Add(new ListItem(General.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; ShowList(); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { //Editor placeholder setup HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new Unit(moduleSettings["Height"].ToString()); // Determine itemID of FAQ to Update if (Request.Params["itemID"] != null) { itemID = Int32.Parse(Request.Params["itemID"]); } // populate with FAQ Details if (Page.IsPostBack == false) { if (itemID != -1) { // get a single row of FAQ info FAQsDB questions = new FAQsDB(); SqlDataReader dr = questions.GetSingleFAQ(itemID); try { // Read database dr.Read(); Question.Text = (string)dr["Question"]; //Answer.Text = (string) dr["Answer"]; DesktopText.Text = (string)dr["Answer"]; CreatedBy.Text = (string)dr["CreatedByUser"]; CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToShortDateString(); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown" || CreatedBy.Text == string.Empty) { CreatedBy.Text = General.GetString("UNKNOWN", "unknown"); } } finally { dr.Close(); } } } }
/// <summary> /// HtmlModule Constructor /// Set the Module Settings /// <list type=""> /// <item>ShowMobile</item> /// </list> /// </summary> public HtmlModule() { int _groupOrderBase; SettingItemGroup _Group; #region Module Special Settings _Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; _groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS; HtmlEditorDataType.HtmlEditorSettings(_baseSettings, _Group); //If false the input box for mobile content will be hidden SettingItem ShowMobileText = new SettingItem(new BooleanDataType()); ShowMobileText.Value = "true"; ShowMobileText.Order = _groupOrderBase + 10; ShowMobileText.Group = _Group; _baseSettings.Add("ShowMobile", ShowMobileText); #endregion #region Button Display Settings for this module // added by Hongwei Shen([email protected]) 10/9/2005 _Group = SettingItemGroup.BUTTON_DISPLAY_SETTINGS; _groupOrderBase = (int)SettingItemGroup.BUTTON_DISPLAY_SETTINGS; //If false the compare button will be hidden SettingItem ShowCompareButton = new SettingItem(new BooleanDataType()); ShowCompareButton.Value = "true"; ShowCompareButton.Order = _groupOrderBase + 60; ShowCompareButton.Group = _Group; ShowCompareButton.EnglishName = "Show Compare Button?"; ShowCompareButton.Description = "Compare the working version with the live one"; _baseSettings.Add(COMPARE_BUTTON, ShowCompareButton); // end of addition #endregion SupportsWorkflow = true; // No need for view state on view. - jminond // Need viewstate to toggle the compare button Hongwei Shen 10/9/2005 EnableViewState = true; // false; }
// end of addition // /// <summary> // /// PlaceHolder for the HTML // /// </summary> // protected PlaceHolder HtmlHolder; #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref = "HtmlModule" /> class. /// Set the Module Settings /// <list type = ""> /// <item> /// ShowMobile /// </item> /// </list> /// </summary> /// <remarks> /// </remarks> public HtmlModule() { var group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; var groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS; HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, group); // If false the input box for mobile content will be hidden var showMobileText = new SettingItem <bool, CheckBox> { Value = true, Order = groupOrderBase + 10, Group = group }; this.BaseSettings.Add("ShowMobile", showMobileText); #region Button Display Settings for this module // added by Hongwei Shen([email protected]) 10/9/2005 group = SettingItemGroup.BUTTON_DISPLAY_SETTINGS; groupOrderBase = (int)SettingItemGroup.BUTTON_DISPLAY_SETTINGS; // If false the compare button will be hidden var showCompareButton = new SettingItem <bool, CheckBox> { Value = true, Order = groupOrderBase + 60, Group = group, EnglishName = "Show Compare Button?", Description = "Compare the working version with the live one" }; this.BaseSettings.Add(StringsCompareButton, showCompareButton); // end of addition #endregion this.SupportsWorkflow = true; // No need for view state on view. - jminond // Need view state to toggle the compare button Hongwei Shen 10/9/2005 this.EnableViewState = true; // false; }
public Articles() { // Set Editor Settings [email protected] 2004/07/30 HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); //Switches date display on/off SettingItem ShowDate = new SettingItem(new BooleanDataType()); ShowDate.Value = "True"; ShowDate.EnglishName = "Show Date"; ShowDate.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; ShowDate.Order = 10; this._baseSettings.Add("ShowDate", ShowDate); //Added by Rob Siera SettingItem DefaultVisibleDays = new SettingItem(new IntegerDataType()); DefaultVisibleDays.Value = "90"; DefaultVisibleDays.EnglishName = "Default Days Visible"; DefaultVisibleDays.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; DefaultVisibleDays.Order = 20; this._baseSettings.Add("DefaultVisibleDays", DefaultVisibleDays); // }
public HtmlModule() { int _groupOrderBase; SettingItemGroup _Group; #region Module Special Settings _Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; _groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS; HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, _Group); //If false the input box for mobile content will be hidden SettingItem ShowMobileText = new SettingItem(new BooleanDataType()); ShowMobileText.Value = "true"; ShowMobileText.Order = _groupOrderBase + 10; ShowMobileText.Group = _Group; this._baseSettings.Add("ShowMobile", ShowMobileText); #endregion this.SupportsWorkflow = true; // No need for view state on view. - jminond this.EnableViewState = false; }
/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the announcement to edit. /// It then uses the Rainbow.AnnouncementsDB() data component /// to populate the page's edit controls with the annoucement details. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { // If the page is being requested the first time, determine if an // announcement itemID value is specified, and if so populate page // contents with the announcement details //Indah Fuldner HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new Unit(moduleSettings["Height"].ToString()); //End Indah Fuldner // 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 (Page.IsPostBack == false) { if (ItemID != 0) { // Obtain a single row of announcement information AnnouncementsDB announcementDB = new AnnouncementsDB(); SqlDataReader dr = announcementDB.GetSingleAnnouncement(ItemID, WorkFlowVersion.Staging); try { // Load first row into DataReader if (dr.Read()) { TitleField.Text = (string)dr["Title"]; MoreLinkField.Text = (string)dr["MoreLink"]; MobileMoreField.Text = (string)dr["MobileMoreLink"]; DesktopText.Text = (string)dr["Description"]; ExpireField.Text = ((DateTime)dr["ExpireDate"]).ToShortDateString(); CreatedBy.Text = (string)dr["CreatedByUser"]; CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToShortDateString(); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown") { CreatedBy.Text = General.GetString("UNKNOWN", "unknown"); } } } finally { // Close the datareader dr.Close(); } } else { ExpireField.Text = DateTime.Now.AddDays(Int32.Parse(moduleSettings["DelayExpire"].ToString())).ToShortDateString(); deleteButton.Visible = false; // Cannot delete an unexsistent item } } }
/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the event to edit. /// It then uses the Rainbow.EventsDB() data component /// to populate the page's edit controls with the event details. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { // Added EsperantusKeys for Localization // Mario Endara [email protected] 11/05/2004 foreach (ListItem item in AllDay.Items) { switch (AllDay.Items.IndexOf(item)) { case 0: item.Text = General.GetString("EVENTS_ALLDAY"); break; case 1: item.Text = General.GetString("EVENTS_STARTAT"); break; } } //Change Indah Fuldner [email protected] HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DescriptionField = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DescriptionField.Width = new Unit(moduleSettings["Width"].ToString()); DescriptionField.Height = new Unit(moduleSettings["Height"].ToString()); //End Change Indah Fuldner [email protected] // If the page is being requested the first time, determine if an // event itemID value is specified, and if so populate page // contents with the event details if (Page.IsPostBack == false) { if (ItemID != 0) { // Obtain a single row of event information EventsDB events = new EventsDB(); SqlDataReader dr = events.GetSingleEvent(ItemID, WorkFlowVersion.Staging); try { // Read first row from database if (dr.Read()) { TitleField.Text = (string)dr["Title"]; DescriptionField.Text = (string)dr["Description"]; // devsolution 2003/6/17: Added items for calendar control if ((bool)dr["AllDay"]) { AllDay.SelectedIndex = 0; } else { int hour = 0; int minute = 0; AllDay.SelectedIndex = 1; StartHour.Enabled = StartMinute.Enabled = StartAMPM.Enabled = true; string[] TimeParts = dr["StartTime"].ToString().Split(new Char[] { ':' }); try { if (TimeParts[0].Length > 0) { hour = int.Parse(TimeParts[0]); } if (TimeParts.Length > 1) { minute = int.Parse(TimeParts[1]); } } catch { } if (hour > 11) { StartAMPM.SelectedIndex = 1; if (hour > 12) { hour -= 12; } } else { if (hour == 0) { hour = 12; } StartAMPM.SelectedIndex = 0; } StartHour.SelectedIndex = hour - 1; StartMinute.SelectedIndex = minute / 5; } if (dr["StartDate"] != DBNull.Value) { StartDate.Text = ((DateTime)dr["StartDate"]).ToShortDateString(); } else { StartDate.Text = string.Empty; } // devsolution 2003/6/17: Finished - Added items for calendar control ExpireField.Text = ((DateTime)dr["ExpireDate"]).ToShortDateString(); CreatedBy.Text = (string)dr["CreatedByUser"]; WhereWhenField.Text = (string)dr["WhereWhen"]; CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToShortDateString(); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown") { CreatedBy.Text = General.GetString("UNKNOWN", "unknown"); } } } finally { dr.Close(); } } else { ExpireField.Text = DateTime.Now.AddDays(Int32.Parse(moduleSettings["DelayExpire"].ToString())).ToShortDateString(); deleteButton.Visible = false; // Cannot delete an unexsistent item } } }
/// <summary> /// Initializes a new instance of the <see cref = "Articles" /> class. /// </summary> public Articles() { this.SupportsWorkflow = true; if (this.PortalSettings == null) { return; } // check for avoid design time errors // modified by Hongwei Shen([email protected]) 12/9/2005 const SettingItemGroup Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; const int GroupBase = (int)Group; // end of modification // Set Editor Settings [email protected] 2004/07/30 // modified by Hongwei Shen // HtmlEditorDataType.HtmlEditorSettings (this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, Group); // end of modification // Switches date display on/off var showDate = new SettingItem <bool, CheckBox> { Value = true, EnglishName = "Show Date", Group = Group, Order = GroupBase + 20 }; // modified by Hongwei Shen // ShowDate.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // ShowDate.Order = 10; // end of modification this.BaseSettings.Add("ShowDate", showDate); // Added by Rob Siera var defaultVisibleDays = new SettingItem <int, TextBox> { Value = 90, EnglishName = "Default Days Visible", Group = Group, Order = GroupBase + 25 }; // modified by Hongwei Shen // DefaultVisibleDays.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // DefaultVisibleDays.Order = 20; // end of modification this.BaseSettings.Add("DefaultVisibleDays", defaultVisibleDays); var richAbstract = new SettingItem <bool, CheckBox> { Value = true, EnglishName = "Rich Abstract", Description = "User rich editor for abstract", Group = Group, Order = GroupBase + 30 }; // modified by Hongwei Shen // RichAbstract.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // RichAbstract.Order = 30; // end of modification this.BaseSettings.Add("ARTICLES_RICHABSTRACT", richAbstract); var users = new UsersDB(); var rolesViewExpiredItems = new SettingItem <string, CheckBoxList>( new CheckBoxListDataType( users.GetPortalRoles(this.PortalSettings.PortalAlias), "RoleName", "RoleName")) { Value = "Admins", EnglishName = "Expired items visible to", Description = "Role that can see expire items", Group = Group, Order = GroupBase + 40 }; // modified by Hongwei Shen // RolesViewExpiredItems.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // RolesViewExpiredItems.Order = 40; // end of modification this.BaseSettings.Add("EXPIRED_PERMISSION_ROLE", rolesViewExpiredItems); }
/// <summary> /// Initializes a new instance of the <see cref="T:Articles"/> class. /// </summary> public Articles() { SupportsWorkflow = true; if (portalSettings != null) //check for avoid design time errors { // modified by Hongwei Shen([email protected]) 12/9/2005 SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; int groupBase = (int)group; // end of modification // Set Editor Settings [email protected] 2004/07/30 // modified by Hongwei Shen //HtmlEditorDataType.HtmlEditorSettings (this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); HtmlEditorDataType.HtmlEditorSettings(_baseSettings, group); // end of modification //Switches date display on/off SettingItem ShowDate = new SettingItem(new BooleanDataType()); ShowDate.Value = "True"; ShowDate.EnglishName = "Show Date"; // modified by Hongwei Shen // ShowDate.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // ShowDate.Order = 10; ShowDate.Group = group; ShowDate.Order = groupBase + 20; // end of midification _baseSettings.Add("ShowDate", ShowDate); //Added by Rob Siera SettingItem DefaultVisibleDays = new SettingItem(new IntegerDataType()); DefaultVisibleDays.Value = "90"; DefaultVisibleDays.EnglishName = "Default Days Visible"; // modified by Hongwei Shen // DefaultVisibleDays.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // DefaultVisibleDays.Order = 20; DefaultVisibleDays.Group = group; DefaultVisibleDays.Order = groupBase + 25; // end of midification _baseSettings.Add("DefaultVisibleDays", DefaultVisibleDays); SettingItem RichAbstract = new SettingItem(new BooleanDataType()); RichAbstract.Value = "True"; RichAbstract.EnglishName = "Rich Abstract"; RichAbstract.Description = "User rich editor for abstract"; // modified by Hongwei Shen // RichAbstract.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // RichAbstract.Order = 30; RichAbstract.Group = group; RichAbstract.Order = groupBase + 30; // end of midification _baseSettings.Add("ARTICLES_RICHABSTRACT", RichAbstract); UsersDB users = new UsersDB(); SettingItem RolesViewExpiredItems = new SettingItem( new CheckBoxListDataType(users.GetPortalRoles(portalSettings.PortalAlias), "RoleName", "RoleName")); RolesViewExpiredItems.Value = "Admins"; RolesViewExpiredItems.EnglishName = "Expired items visible to"; RolesViewExpiredItems.Description = "Role that can see expire items"; // modified by Hongwei Shen // RolesViewExpiredItems.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // RolesViewExpiredItems.Order = 40; RolesViewExpiredItems.Group = group; RolesViewExpiredItems.Order = groupBase + 40; // end of midification _baseSettings.Add("EXPIRED_PERMISSION_ROLE", RolesViewExpiredItems); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = this.ModuleSettings["Editor"].ToString(); DesktopText = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(this.ModuleSettings["ShowUpload"].ToString()), this.PortalSettings); DesktopText.Width = new Unit(this.ModuleSettings["Width"].ToString()); DesktopText.Height = new Unit(this.ModuleSettings["Height"].ToString()); if (!Page.IsPostBack) { if (bool.Parse(this.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(this.PortalSettings.PortalID), "ModuleTitle", "ModuleID"); listModules.CssClass = "NormalTextBox"; listModules.DataSource = cldt.DataSource; listModules.DataValueField = cldt.DataValueField; listModules.DataTextField = cldt.DataTextField; listModules.DataBind(); string comando = General.GetString("ENHANCEDHTML_CONFIRMDELETEMESSAGE", "Are You Sure You Wish To Delete This Item ?"); cmdDeletePage.Attributes.Add("onClick", "javascript:return confirm('" + comando + "');"); ViewState["UrlReferrer"] = HttpUrlBuilder.BuildUrl(PageID); CultureInfo[] listaLang = LanguageSwitcher.GetLanguageList(true); lstLanguages.Items.Add(new ListItem(General.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; ShowList(); } }
/// <summary> /// Initializes a new instance of the <see cref="EnhancedHtml"/> class. /// </summary> /// <remarks> /// </remarks> public EnhancedHtml() { const SettingItemGroup Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // modified by Hongwei Shen([email protected]) 12/9/2005 // _groupOrderBase = 0; const int GroupOrderBase = (int)Group; // end of modification HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, Group); var showTitlePage = new SettingItem <bool, CheckBox> { Value = false, Order = GroupOrderBase + 20, Group = Group, EnglishName = "Show Title Page?", Description = "Mark this if you like see the Title Page" }; this.BaseSettings.Add("ENHANCEDHTML_SHOWTITLEPAGE", showTitlePage); var showUpMenu = new SettingItem <bool, CheckBox> { Value = false, Order = GroupOrderBase + 25, Group = Group, EnglishName = "Show Index Menu?", Description = "Mark this if you would like to see an index menu with the titles of all pages" }; this.BaseSettings.Add("ENHANCEDHTML_SHOWUPMENU", showUpMenu); var alignUpMenu = new List <SettingOption> { new SettingOption(1, General.GetString("LEFT", "Left")), new SettingOption(2, General.GetString("CENTER", "Center")), new SettingOption(3, General.GetString("RIGHT", "Right")) }; var labelAlignUpMenu = new SettingItem <string, ListControl>(new CustomListDataType(alignUpMenu, "Name", "Val")) { Description = "Select here the align for index menu", EnglishName = "Align Index Menu", Value = "1", Order = GroupOrderBase + 30 }; this.BaseSettings.Add("ENHANCEDHTML_ALIGNUPMENU", labelAlignUpMenu); var showDownMenu = new SettingItem <bool, CheckBox> { Value = true, Order = GroupOrderBase + 40, Group = Group, EnglishName = "Show Navigation Menu?", Description = "Mark this if you like see a navigation menu with previous and next page" }; this.BaseSettings.Add("ENHANCEDHTML_SHOWDOWNMENU", showDownMenu); var alignDownMenu = new List <SettingOption> { new SettingOption(1, General.GetString("LEFT", "Left")), new SettingOption(2, General.GetString("CENTER", "Center")), new SettingOption(3, General.GetString("RIGHT", "Right")) }; var labelAlignDownMenu = new SettingItem <string, ListControl>(new CustomListDataType(alignDownMenu, "Name", "Val")) { Description = "Select here the align for index menu", EnglishName = "Align Navigation Menu", Value = "3", Order = GroupOrderBase + 50 }; this.BaseSettings.Add("ENHANCEDHTML_ALIGNDOWNMENU", labelAlignDownMenu); var addInvariant = new SettingItem <bool, CheckBox> { Value = true, Order = GroupOrderBase + 60, Group = Group, EnglishName = "Add Invariant Culture?", Description = "Mark this if you like see pages with invariant culture after pages with actual culture code" }; this.BaseSettings.Add("ENHANCEDHTML_ADDINVARIANTCULTURE", addInvariant); var showMultiMode = new SettingItem <bool, CheckBox> { Value = true, Order = GroupOrderBase + 70, Group = Group, EnglishName = "Show Multi-Mode icon?", Description = "Mark this if you like see icon multimode page" }; this.BaseSettings.Add("ENHANCEDHTML_SHOWMULTIMODE", showMultiMode); var getContentsFromPortals = new SettingItem <bool, CheckBox> { Value = false, Order = GroupOrderBase + 80, Group = Group, EnglishName = "Get contents from others Portals?", Description = "Mark this if you like get contents from modules in others portals in the same database" }; this.BaseSettings.Add("ENHANCEDHTML_GET_CONTENTS_FROM_PORTALS", getContentsFromPortals); this.SupportsWorkflow = true; }
/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the task to edit. /// It then uses the Rainbow.TasksDB() data component /// to populate the page's edit controls with the task details. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, EventArgs e) { // If the page is being requested the first time, determine if an // task itemID value is specified, and if so populate page // contents with the task details //Chris Farrell, [email protected], 5/28/04 //Added support for Rainbow WYSIWYG editors. //Editor placeholder setup HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = moduleSettings["Editor"].ToString(); DesktopText = h.GetEditor(DescriptionField, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new Unit(moduleSettings["Height"].ToString()); //end Chris Farrell changes, 5/28/04 //Set right popup url StartField.xPopupURL = Path.ApplicationRoot + "/DesktopModules/DateTextBox/popupcalendar.aspx"; StartField.xImageURL = Path.ApplicationRoot + "/DesktopModules/DateTextBox/calendar.jpg"; DueField.xPopupURL = Path.ApplicationRoot + "/DesktopModules/DateTextBox/popupcalendar.aspx"; DueField.xImageURL = Path.ApplicationRoot + "/DesktopModules/DateTextBox/calendar.jpg"; if (Page.IsPostBack == false) { StartField.Text = DateTime.Now.ToShortDateString(); DueField.Text = DateTime.Now.ToShortDateString(); AddListItem("TASK_STATE_0", "Not Started", StatusField); AddListItem("TASK_STATE_1", "In Progress", StatusField); AddListItem("TASK_STATE_2", "Complete", StatusField); StatusField.SelectedIndex = 0; AddListItem("TASK_PRIORITY_0", "High", PriorityField); AddListItem("TASK_PRIORITY_1", "Normal", PriorityField); AddListItem("TASK_PRIORITY_2", "Low", PriorityField); PriorityField.SelectedIndex = 1; if (ItemID != 0) { // Obtain a single row of Task information TasksDB Tasks = new TasksDB(); SqlDataReader dr = Tasks.GetSingleTask(ItemID); try { // Read first row from database if (dr.Read()) { TitleField.Text = (string)dr["Title"]; StartField.Text = ((DateTime)dr["StartDate"]).ToShortDateString(); DueField.Text = ((DateTime)dr["DueDate"]).ToShortDateString(); CreatedBy.Text = (string)dr["CreatedByUser"]; ModifiedBy.Text = (string)dr["ModifiedByUser"]; PercentCompleteField.Text = ((Int32)dr["PercentComplete"]).ToString(); AssignedField.Text = (string)dr["AssignedTo"]; CreatedDate.Text = ((DateTime)dr["CreatedDate"]).ToString(); ModifiedDate.Text = ((DateTime)dr["ModifiedDate"]).ToString(); StatusField.SelectedIndex = Convert.ToInt16((string)dr["Status"]); PriorityField.SelectedIndex = Convert.ToInt16((string)dr["Priority"]); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown") { CreatedBy.Text = General.GetString("UNKNOWN", "unknown"); } // 15/7/2004 added localization by Mario Endara [email protected] if (ModifiedBy.Text == "unknown") { ModifiedBy.Text = General.GetString("UNKNOWN", "unknown"); } //Chris Farrell, [email protected], 5/28/04 //DescriptionField.Text = (string) dr["Description"]; DesktopText.Text = (string)dr["Description"]; } } finally { dr.Close(); } } else //default for new { AssignedField.Text = moduleSettings["TASKS_DEFAULT_ASSIGNEE"].ToString(); } } }
/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the event to edit. /// It then uses the Appleseed.EventsDB() data component /// to populate the page's edit controls with the event details. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { // Added EsperantusKeys for Localization // Mario Endara [email protected] 11/05/2004 foreach (ListItem item in AllDay.Items) { switch (AllDay.Items.IndexOf(item)) { case 0: item.Text = General.GetString("EVENTS_ALLDAY"); break; case 1: item.Text = General.GetString("EVENTS_STARTAT"); break; } } //Change Indah Fuldner [email protected] HtmlEditorDataType h = new HtmlEditorDataType(); h.Value = this.ModuleSettings["Editor"].ToString(); DescriptionField = h.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(this.ModuleSettings["ShowUpload"].ToString()), this.PortalSettings); DescriptionField.Width = new Unit(this.ModuleSettings["Width"].ToString()); DescriptionField.Height = new Unit(this.ModuleSettings["Height"].ToString()); //End Change Indah Fuldner [email protected] // If the page is being requested the first time, determine if an // event itemID value is specified, and if so populate page // contents with the event details if (Page.IsPostBack == false) { if (ItemID != 0) { // Obtain a single row of event information EventsDB events = new EventsDB(); SqlDataReader dr = events.GetSingleEvent(ItemID, WorkFlowVersion.Staging); try { // Read first row from database if (dr.Read()) { TitleField.Text = (string) dr["Title"]; DescriptionField.Text = (string) dr["Description"]; // devsolution 2003/6/17: Added items for calendar control if ((bool) dr["AllDay"]) { AllDay.SelectedIndex = 0; } else { int hour = 0; int minute = 0; AllDay.SelectedIndex = 1; StartHour.Enabled = StartMinute.Enabled = StartAMPM.Enabled = true; string[] TimeParts = dr["StartTime"].ToString().Split(new Char[] {':'}); try { if (TimeParts[0].Length > 0) hour = int.Parse(TimeParts[0]); if (TimeParts.Length > 1) minute = int.Parse(TimeParts[1]); } catch { } if (hour > 11) { StartAMPM.SelectedIndex = 1; if (hour > 12) hour -= 12; } else { if (hour == 0) hour = 12; StartAMPM.SelectedIndex = 0; } StartHour.SelectedIndex = hour - 1; StartMinute.SelectedIndex = minute/5; } if (dr["StartDate"] != DBNull.Value) StartDate.Text = ((DateTime) dr["StartDate"]).ToShortDateString(); else StartDate.Text = string.Empty; // devsolution 2003/6/17: Finished - Added items for calendar control ExpireField.Text = ((DateTime) dr["ExpireDate"]).ToShortDateString(); CreatedBy.Text = (string) dr["CreatedByUser"]; WhereWhenField.Text = (string) dr["WhereWhen"]; CreatedDate.Text = ((DateTime) dr["CreatedDate"]).ToShortDateString(); // 15/7/2004 added localization by Mario Endara [email protected] if (CreatedBy.Text == "unknown") { CreatedBy.Text = General.GetString("UNKNOWN", "unknown"); } } } finally { dr.Close(); } } else { ExpireField.Text = DateTime.Now.AddDays(Int32.Parse(this.ModuleSettings["DelayExpire"].ToString())).ToShortDateString(); this.DeleteButton.Visible = false; // Cannot delete an unexsistent item } } }
/// <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, 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 Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new 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 = General.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(); } } }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public Announcements() { // Set Editor Settings [email protected] 2004/07/30 HtmlEditorDataType.HtmlEditorSettings(_baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); //Custom settings SettingItem DelayExpire = new SettingItem(new IntegerDataType()); DelayExpire.Value = "60"; DelayExpire.MinValue = 0; DelayExpire.MaxValue = 3650; //10 years DelayExpire.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; DelayExpire.Description = string.Empty; _baseSettings.Add("DelayExpire", DelayExpire); //Indah Fuldner SettingItem RepeatDirection = new SettingItem(new ListDataType("Vertical;Horizontal")); RepeatDirection.Required = true; RepeatDirection.Value = "Vertical"; RepeatDirection.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatDirection.Description = string.Empty; _baseSettings.Add("RepeatDirectionSetting", RepeatDirection); SettingItem RepeatColumn = new SettingItem(new IntegerDataType()); RepeatColumn.Required = true; RepeatColumn.Value = "1"; RepeatColumn.MinValue = 1; RepeatColumn.MaxValue = 10; RepeatColumn.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatColumn.Description = string.Empty; _baseSettings.Add("RepeatColumns", RepeatColumn); SettingItem showItemBorder = new SettingItem(new BooleanDataType()); showItemBorder.Value = "false"; showItemBorder.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; showItemBorder.Description = string.Empty; _baseSettings.Add("ShowBorder", showItemBorder); //End Indah Fuldner //begin Chris Farrell, 09/05/2005, [email protected] //Setting item to control page size for paging SettingItem PageSize = new SettingItem(new IntegerDataType()); PageSize.Required = true; PageSize.Value = "15"; PageSize.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; PageSize.Description = "Default page size for paging"; _baseSettings.Add("PageSize", PageSize); //end chris farrell SettingItem setSortField = new SettingItem(new ListDataType("Title;CreatedDate;ExpireDate")); setSortField.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; setSortField.Required = true; setSortField.EnglishName = "Sort Field"; setSortField.Value = "ExpireDate"; _baseSettings.Add("SortField", setSortField); SettingItem setSortDirection = new SettingItem(new ListDataType("ASC;DESC")); setSortDirection.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; setSortDirection.Required = true; setSortDirection.EnglishName = "Sort Direction"; setSortDirection.Value = "DESC"; _baseSettings.Add("SortDirection", setSortDirection); // Change by [email protected] // Date: 27/2/2003 SupportsWorkflow = true; // End Change [email protected] }
/// <summary> /// Handles OnInit event /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> /// <remarks> /// The Page_Load event on this Page is used to obtain the ModuleID /// of the xml module to edit. /// It then uses the Appleseed.HtmlTextDB() data component /// to populate the page's edit controls with the text details. /// </remarks> protected override void OnInit(EventArgs e) { // Controls must be created here this.UpdateButton = new LinkButton(); this.CancelButton = new LinkButton(); // Add the setting var editor = this.ModuleSettings["Editor"].ToString(); var width = this.ModuleSettings["Width"].ToString(); var height = this.ModuleSettings["Height"].ToString(); var showUpload = this.ModuleSettings["ShowUpload"].ToBoolean(CultureInfo.InvariantCulture); var showMobile = this.ModuleSettings["ShowMobile"].ToBoolean(CultureInfo.InvariantCulture); if (this.IsCodeWriter && !Request.Url.PathAndQuery.ToLower().Contains("modalchangemaster")) { Response.Redirect(Request.Url.PathAndQuery + "&ModalChangeMaster=true", true); } plcCodewriter.Visible = editor.ToLower() == "codewriter"; plcNoCodeWriter.Visible = editor.ToLower() != "codewriter"; plcCSSCMEditor.Visible = editor.ToLower() == "code mirror plain text"; plcCSSCKEditor.Visible = editor.ToLower() == "ckeditor"; var h = new HtmlEditorDataType { Value = editor }; this.DesktopText = h.GetEditor( this.PlaceHolderHTMLEditor, this.ModuleID, showUpload, this.PortalSettings); this.DesktopText.Width = new Unit(width); this.DesktopText.Height = new Unit(height); if (editor.ToLower() == "codewriter") { var moduleImageFolder = Appleseed.Framework.Site.Configuration.ModuleSettings.GetModuleSettings(this.ModuleID)["MODULE_IMAGE_FOLDER"].ToString(); cwCKEditor = new Framework.UI.WebControls.CKEditorTextbox { ImageFolder = moduleImageFolder, ResizeEnabled = false, Language = PortalSettings.PortalUILanguage.TwoLetterISOLanguageName }; cwCKEditor.Height = 470; cwCKEditor.BasePath = Appleseed.Framework.Settings.Path.WebPathCombine(Appleseed.Framework.Settings.Path.ApplicationRoot, "/aspnet_client/CKEditorV4.6.2"); this.plcCWCKEditor.Controls.Add((Control)cwCKEditor); } if (showMobile) { this.MobileRow.Visible = true; this.MobileSummary.Width = new Unit(width); this.MobileDetails.Width = new Unit(width); } else { this.MobileRow.Visible = false; } // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) this.UpdateButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.UpdateButton); this.PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); this.CancelButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.CancelButton); //Get versionList HtmlTextDB versionDB = new HtmlTextDB(); SqlDataReader drList = versionDB.GetHtmlTextRecord(this.ModuleID); ListItem item = new ListItem(); if (drList.HasRows) { while (drList.Read()) { item = new ListItem(); if (Convert.ToBoolean(drList["Published"])) { item.Text = drList["VersionNo"].ToString() + " [Published]"; item.Value = drList["VersionNo"].ToString(); item.Selected = true; } else { item.Text = drList["VersionNo"].ToString(); item.Value = drList["VersionNo"].ToString(); } drpVirsionList.Items.Add(item); } } //Added by Ashish - Connection pool Issue if (drList != null) { drList.Close(); } if (drpVirsionList.Items.Count == 0) { item.Text = "1 [Published]"; item.Value = "1"; item.Selected = true; drpVirsionList.Items.Add(item); } LoadHTMLText(); base.OnInit(e); }
public Blog() { // by Hongwei Shen([email protected]) 9/12/2005 SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; int groupBase = (int)group; // end of modification // Set Editor Settings [email protected] 2004/07/30 // by Hongwei Shen // HtmlEditorDataType.HtmlEditorSettings (this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); HtmlEditorDataType.HtmlEditorSettings(_baseSettings, group); //Number of entries to display SettingItem EntriesToShow = new SettingItem(new IntegerDataType()); EntriesToShow.Value = "10"; // by Hongwei Shen // EntriesToShow.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // EntriesToShow.Order = 10; EntriesToShow.Group = group; EntriesToShow.Order = groupBase + 20; // end of modification _baseSettings.Add("Entries To Show", EntriesToShow); //Channel Description SettingItem Description = new SettingItem(new StringDataType()); Description.Value = "Description"; // by Hongwei Shen // Description.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // Description.Order = 20; Description.Group = group; Description.Order = groupBase + 25; // end of modification _baseSettings.Add("Description", Description); //Channel Copyright SettingItem Copyright = new SettingItem(new StringDataType()); Copyright.Value = "Copyright"; // by Hongwei Shen // Copyright.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // Copyright.Order = 30; Copyright.Group = group; Copyright.Order = groupBase + 30; // end of modification _baseSettings.Add("Copyright", Copyright); //Channel Language SettingItem Language = new SettingItem(new StringDataType()); Language.Value = "en-us"; // by Hongwei Shen // Language.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // Language.Order = 40; Language.Group = group; Language.Order = groupBase + 40; // end of modification _baseSettings.Add("Language", Language); //Author SettingItem Author = new SettingItem(new StringDataType()); Author.Value = "Author"; // by Hongwei Shen // Author.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // Author.Order = 50; Author.Group = group; Author.Order = groupBase + 50; // end of modification _baseSettings.Add("Author", Author); //Author Email SettingItem AuthorEmail = new SettingItem(new StringDataType()); AuthorEmail.Value = "*****@*****.**"; // by Hongwei Shen // AuthorEmail.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // AuthorEmail.Order = 60; AuthorEmail.Group = group; AuthorEmail.Order = groupBase + 60; // end of modification _baseSettings.Add("Author Email", AuthorEmail); //Time to live in minutes for RSS //how long a channel can be cached before refreshing from the source SettingItem TimeToLive = new SettingItem(new IntegerDataType()); TimeToLive.Value = "120"; // by Hongwei Shen // TimeToLive.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; // TimeToLive.Order = 70; TimeToLive.Group = group; TimeToLive.Order = groupBase + 70; // end of modification _baseSettings.Add("RSS Cache Time In Minutes", TimeToLive); }
protected override void OnInit(EventArgs e) { // Controls must be created here this.UpdateButton = new LinkButton(); this.CancelButton = new LinkButton(); //this.VersionHistory = new LinkButton(); // Add the setting var editor = this.ModuleSettings["Editor"].ToString(); var width = this.ModuleSettings["Width"].ToString(); var height = this.ModuleSettings["Height"].ToString(); var showUpload = this.ModuleSettings["ShowUpload"].ToBoolean(CultureInfo.InvariantCulture); var showMobile = this.ModuleSettings["ShowMobile"].ToBoolean(CultureInfo.InvariantCulture); var h = new HtmlEditorDataType { Value = editor }; this.DesktopText = h.GetEditor( this.PlaceHolderHTMLEditor, this.ModuleID, showUpload, this.PortalSettings); this.DesktopText.Width = new Unit(width); this.DesktopText.Height = new Unit(height); if (showMobile) { this.MobileRow.Visible = true; this.MobileSummary.Width = new Unit(width); this.MobileDetails.Width = new Unit(width); } else { this.MobileRow.Visible = false; } // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) this.UpdateButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.UpdateButton); this.PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); this.CancelButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.CancelButton); //Get versionList //["*****@*****.**", "2014/11/20", "Get HtmlText versions by ModuleID"] HtmlTextDB versionDB = new HtmlTextDB(); SqlDataReader drList = versionDB.GetHtmlTextRecord(this.ModuleID); ListItem item = new ListItem(); if (drList.HasRows) { while (drList.Read()) { item = new ListItem(); if (Convert.ToBoolean(drList["Published"])) { item.Text = drList["VersionNo"].ToString() + " [Published]"; item.Value = drList["VersionNo"].ToString(); item.Selected = true; } else { item.Text = drList["VersionNo"].ToString(); item.Value = drList["VersionNo"].ToString(); } drpVirsionList.Items.Add(item); } } //Added by Ashish - Connection pool Issue if (drList != null) { drList.Close(); } if (drpVirsionList.Items.Count == 0) { item.Text = "1 [Published]"; item.Value = "1"; item.Selected = true; drpVirsionList.Items.Add(item); } LoadHTMLText(); base.OnInit(e); }
/// <summary> /// The Page_Load event on this Page is used to obtain the ModuleID /// and ItemID of the Article to edit. /// It then uses the Rainbow.ArticlesDB() data component /// to populate the page's edit controls with the Article details. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { // Add the setting HtmlEditorDataType editor = new HtmlEditorDataType(); editor.Value = moduleSettings["Editor"].ToString(); DesktopText = editor.GetEditor(PlaceHolderHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); DesktopText.Width = new Unit(moduleSettings["Width"].ToString()); DesktopText.Height = new Unit(moduleSettings["Height"].ToString()); HtmlEditorDataType abstractEditor = new HtmlEditorDataType(); if (moduleSettings["ARTICLES_RICHABSTRACT"] != null && bool.Parse(moduleSettings["ARTICLES_RICHABSTRACT"].ToString())) { abstractEditor.Value = moduleSettings["Editor"].ToString(); AbstractText = abstractEditor.GetEditor(PlaceHolderAbstractHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); } else { abstractEditor.Value = "Plain Text"; AbstractText = abstractEditor.GetEditor(PlaceHolderAbstractHTMLEditor, ModuleID, bool.Parse(moduleSettings["ShowUpload"].ToString()), portalSettings); } AbstractText.Width = new Unit(moduleSettings["Width"].ToString()); AbstractText.Height = new Unit("130px"); // 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 // Article itemID value is specified, and if so populate page // contents with the Article details if (Page.IsPostBack == false) { if (ItemID != 0) { // Obtain a single row of Article information ArticlesDB Articles = new ArticlesDB(); SqlDataReader dr = Articles.GetSingleArticle(ItemID, WorkFlowVersion.Staging); try { // Load first row into Datareader if (dr.Read()) { StartField.Text = ((DateTime)dr["StartDate"]).ToShortDateString(); ExpireField.Text = ((DateTime)dr["ExpireDate"]).ToShortDateString(); TitleField.Text = (string)dr["Title"].ToString(); SubtitleField.Text = (string)dr["Subtitle"].ToString(); AbstractText.Text = (string)dr["Abstract"].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 = General.GetString("UNKNOWN", "unknown"); } } } finally { dr.Close(); } } else { //New article - set defaults StartField.Text = DateTime.Now.ToShortDateString(); ExpireField.Text = DateTime.Now.AddDays(int.Parse(moduleSettings["DefaultVisibleDays"].ToString())). ToShortDateString(); CreatedBy.Text = PortalSettings.CurrentUser.Identity.Email; CreatedDate.Text = DateTime.Now.ToString(); } } }
public Blog() { // Set Editor Settings [email protected] 2004/07/30 HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS); //Number of entries to display SettingItem EntriesToShow = new SettingItem(new IntegerDataType()); EntriesToShow.Value = "10"; EntriesToShow.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; EntriesToShow.Order = 10; this._baseSettings.Add("Entries To Show", EntriesToShow); //Channel Description SettingItem Description = new SettingItem(new StringDataType()); Description.Value = "Description"; Description.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; Description.Order = 20; this._baseSettings.Add("Description", Description); //Channel Copyright SettingItem Copyright = new SettingItem(new StringDataType()); Copyright.Value = "Copyright"; Copyright.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; Copyright.Order = 30; this._baseSettings.Add("Copyright", Copyright); //Channel Language SettingItem Language = new SettingItem(new StringDataType()); Language.Value = "en-us"; Language.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; Language.Order = 40; this._baseSettings.Add("Language", Language); //Author SettingItem Author = new SettingItem(new StringDataType()); Author.Value = "Author"; Author.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; Author.Order = 50; this._baseSettings.Add("Author", Author); //Author Email SettingItem AuthorEmail = new SettingItem(new StringDataType()); AuthorEmail.Value = "*****@*****.**"; AuthorEmail.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; AuthorEmail.Order = 60; this._baseSettings.Add("Author Email", AuthorEmail); //Time to live in minutes for RSS //how long a channel can be cached before refreshing from the source SettingItem TimeToLive = new SettingItem(new IntegerDataType()); TimeToLive.Value = "120"; TimeToLive.Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; TimeToLive.Order = 70; this._baseSettings.Add("RSS Cache Time In Minutes", TimeToLive); }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public Events() { // Set Editor Settings [email protected] 2004/07/30 (added by Jakob Hansen) // Modified by Hongwei Shen 2005/09/24 SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; int groupBase = (int)group; HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, group); //Indah Fuldner var RepeatDirection = new SettingItem <string, ListControl>(new ListDataType <string, ListControl>("Vertical;Horizontal")); RepeatDirection.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatDirection.Required = true; RepeatDirection.Value = "Vertical"; RepeatDirection.Order = groupBase + 20; //10; this.BaseSettings.Add("RepeatDirectionSetting", RepeatDirection); var RepeatColumn = new SettingItem <int, TextBox>(); RepeatColumn.Group = group; // SettingItemGroup.MODULE_SPECIAL_SETTINGS; RepeatColumn.Required = true; RepeatColumn.Value = 1; RepeatColumn.MinValue = 1; RepeatColumn.MaxValue = 10; RepeatColumn.Order = groupBase + 25; // 20; this.BaseSettings.Add("RepeatColumns", RepeatColumn); var showItemBorder = new SettingItem <bool, CheckBox>(); showItemBorder.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS; showItemBorder.Order = groupBase + 30; showItemBorder.Value = false; this.BaseSettings.Add("ShowBorder", showItemBorder); //End Indah Fuldner var DelayExpire = new SettingItem <int, TextBox>(); DelayExpire.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS; DelayExpire.Order = groupBase + 35; // 40; DelayExpire.Value = 365; // 1 year DelayExpire.MinValue = 0; DelayExpire.MaxValue = 3650; //10 years this.BaseSettings.Add("DelayExpire", DelayExpire); // devsolution 2003/6/17: Added items for calendar control // Show Calendar - Show a visual calendar with // Default is false for backward compatibility // Must edit collection properties and set to true // to show calendar var ShowCalendar = new SettingItem <bool, CheckBox>(); ShowCalendar.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS; ShowCalendar.Order = groupBase + 40; // 50; ShowCalendar.Value = false; this.BaseSettings.Add("ShowCalendar", ShowCalendar); // devsolution 2003/6/17: Finished - Added items for calendar control // Change by [email protected] // Date: 27/2/2003 SupportsWorkflow = true; // End Change [email protected] }
/// <summary> /// Handles OnInit event /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param> /// <remarks> /// The Page_Load event on this Page is used to obtain the ModuleID /// of the xml module to edit. /// It then uses the Appleseed.HtmlTextDB() data component /// to populate the page's edit controls with the text details. /// </remarks> protected override void OnInit(EventArgs e) { // Controls must be created here this.UpdateButton = new LinkButton(); this.CancelButton = new LinkButton(); // Add the setting var editor = this.ModuleSettings["Editor"].ToString(); var width = this.ModuleSettings["Width"].ToString(); var height = this.ModuleSettings["Height"].ToString(); var showUpload = this.ModuleSettings["ShowUpload"].ToBoolean(CultureInfo.InvariantCulture); var h = new HtmlEditorDataType { Value = editor }; this.DesktopText = h.GetEditor( this.PlaceHolderHTMLEditor, this.ModuleID, showUpload, this.PortalSettings); this.DesktopText.Width = new Unit(width); this.DesktopText.Height = new Unit(height); // Construct the page // Added css Styles by Mario Endara <*****@*****.**> (2004/10/26) this.UpdateButton.CssClass = "CommandButton"; this.PlaceHolderButtons.Controls.Add(this.UpdateButton); this.PlaceHolderButtons.Controls.Add(new LiteralControl(" ")); this.CancelButton.CssClass = "CommandButton"; this.CancelButton.ID = "EditHtmlCancelButton"; this.PlaceHolderButtons.Controls.Add(this.CancelButton); // Obtain a single row of text information var text = new HtmlTextDB(); // Change by [email protected] - Date: 7/2/2003 // Original: SqlDataReader dr = text.GetHtmlText(ModuleID); var dr = text.GetHtmlText(this.ModuleID, WorkFlowVersion.Staging, 1); // End Change [email protected] try { if (dr.Read()) { this.DesktopText.Text = this.Server.HtmlDecode((string)dr["DesktopHtml"]); } else { this.DesktopText.Text = General.GetString( "HTMLDOCUMENT_TODO_ADDCONTENT", "Todo: Add Content...", null); } } finally { dr.Close(); } this.dialogclass.Attributes.Add("class", this.ModuleID.ToString()); base.OnInit(e); }
public EnhancedHtml() { int _groupOrderBase; SettingItemGroup _Group; #region Module Settings _Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS; _groupOrderBase = 0; HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, _Group); SettingItem ShowTitlePage = new SettingItem(new BooleanDataType()); ShowTitlePage.Value = "false"; ShowTitlePage.Order = _groupOrderBase + 10; ShowTitlePage.Group = _Group; ShowTitlePage.EnglishName = "Show Title Page?"; ShowTitlePage.Description = "Mark this if you like see the Title Page"; this._baseSettings.Add("ENHANCEDHTML_SHOWTITLEPAGE", ShowTitlePage); SettingItem ShowUpMenu = new SettingItem(new BooleanDataType()); ShowUpMenu.Value = "false"; ShowUpMenu.Order = _groupOrderBase + 20; ShowUpMenu.Group = _Group; ShowUpMenu.EnglishName = "Show Index Menu?"; ShowUpMenu.Description = "Mark this if you like see a index menu whith the titles of all pages"; this._baseSettings.Add("ENHANCEDHTML_SHOWUPMENU", ShowUpMenu); ArrayList alignUpMenu = new ArrayList(); alignUpMenu.Add(new SettingOption(1, Esperantus.Localize.GetString("LEFT", "Left"))); alignUpMenu.Add(new SettingOption(2, Esperantus.Localize.GetString("CENTER", "Center"))); alignUpMenu.Add(new SettingOption(3, Esperantus.Localize.GetString("RIGHT", "Right"))); SettingItem labelAlignUpMenu = new SettingItem(new CustomListDataType(alignUpMenu, "Name", "Val")); labelAlignUpMenu.Description = "Select here the align for index menu"; labelAlignUpMenu.EnglishName = "Align Index Menu"; labelAlignUpMenu.Value = "1"; labelAlignUpMenu.Order = _groupOrderBase + 30; this._baseSettings.Add("ENHANCEDHTML_ALIGNUPMENU", labelAlignUpMenu); SettingItem ShowDownMenu = new SettingItem(new BooleanDataType()); ShowDownMenu.Value = "true"; ShowDownMenu.Order = _groupOrderBase + 40; ShowDownMenu.Group = _Group; ShowDownMenu.EnglishName = "Show Navigation Menu?"; ShowDownMenu.Description = "Mark this if you like see a navigation menu with previous and next page"; this._baseSettings.Add("ENHANCEDHTML_SHOWDOWNMENU", ShowDownMenu); ArrayList alignDownMenu = new ArrayList(); alignDownMenu.Add(new SettingOption(1, Esperantus.Localize.GetString("LEFT", "Left"))); alignDownMenu.Add(new SettingOption(2, Esperantus.Localize.GetString("CENTER", "Center"))); alignDownMenu.Add(new SettingOption(3, Esperantus.Localize.GetString("RIGHT", "Right"))); SettingItem labelAlignDownMenu = new SettingItem(new CustomListDataType(alignDownMenu, "Name", "Val")); labelAlignDownMenu.Description = "Select here the align for index menu"; labelAlignDownMenu.EnglishName = "Align Navigation Menu"; labelAlignDownMenu.Value = "3"; labelAlignDownMenu.Order = _groupOrderBase + 50; this._baseSettings.Add("ENHANCEDHTML_ALIGNDOWNMENU", labelAlignDownMenu); SettingItem AddInvariant = new SettingItem(new BooleanDataType()); AddInvariant.Value = "true"; AddInvariant.Order = _groupOrderBase + 60; AddInvariant.Group = _Group; AddInvariant.EnglishName = "Add Invariant Culture?"; AddInvariant.Description = "Mark this if you like see pages with invariant culture after pages with actual culture code"; this._baseSettings.Add("ENHANCEDHTML_ADDINVARIANTCULTURE", AddInvariant); SettingItem ShowMultiMode = new SettingItem(new BooleanDataType()); ShowMultiMode.Value = "true"; ShowMultiMode.Order = _groupOrderBase + 70; ShowMultiMode.Group = _Group; ShowMultiMode.EnglishName = "Show Multi-Mode icon?"; ShowMultiMode.Description = "Mark this if you like see icon multimode page"; this._baseSettings.Add("ENHANCEDHTML_SHOWMULTIMODE", ShowMultiMode); SettingItem GetContentsFromPortals = new SettingItem(new BooleanDataType()); GetContentsFromPortals.Value = "false"; GetContentsFromPortals.Order = _groupOrderBase + 80; GetContentsFromPortals.Group = _Group; GetContentsFromPortals.EnglishName = "Get contents from others Portals?"; GetContentsFromPortals.Description = "Mark this if you like get contents from modules in others portals in the same database"; this._baseSettings.Add("ENHANCEDHTML_GET_CONTENTS_FROM_PORTALS", GetContentsFromPortals); #endregion this.SupportsWorkflow = true; }