Exemplo n.º 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Obtain the selected item from the HtmlText table
            HtmlTextDB text = new HtmlTextDB();

//			// Change by [email protected] - Date: 7/2/2003
//			// Original: SqlDataReader dr = text.GetHtmlText(ModuleID);
//			SqlDataReader dr = text.GetHtmlText(ModuleID, Version);
//			// End Change [email protected]
//
//			try
//			{
//				if (dr.Read())
//				{
//					// Jes1111
//					// Dynamically add the file content into the page
            this.Content = Server.HtmlDecode(text.GetHtmlTextString(ModuleID, Version));
            this.HtmlHolder.Controls.Add(new LiteralControl(this.Content.ToString()));
//				}
//			}
//			finally
//			{
//				// Close the datareader
//				dr.Close();
//			}
        }
Exemplo n.º 2
0
        /// <summary>
        /// The UpdateBtn_Click event handler on this Page is used to save
        /// the text changes to the database.
        /// </summary>
        override protected void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);
            // Create an instance of the HtmlTextDB component
            HtmlTextDB text = new HtmlTextDB();

            // Update the text within the HtmlText table
            text.UpdateHtmlText(ModuleID, Server.HtmlEncode(DesktopText.Text), Server.HtmlEncode(MobileSummary.Text), Server.HtmlEncode(MobileDetails.Text));
            this.RedirectBackToReferringPage();
        }
Exemplo n.º 3
0
        /// <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("&#160;"));
            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();
                }
            }
        }