/// <summary>Converts HTML.</summary> /// <returns>The time convert.</returns> private string DesignTimeConvert() { var queryString = WebUtil.GetQueryString("mode"); var body = StringUtil.GetString(Request.Form["html"]); string str; if (queryString == "HTML") { str = RuntimeHtml.Convert(body, Settings.HtmlEditor.SupportWebControls); } else { var querystring = new NameValueCollection(1) { { "sc_live", "0" } }; var controlName = string.Empty; if (Settings.HtmlEditor.SupportWebControls) { controlName = "control:IDEHtmlEditorControl"; } str = DesignTimeHtml.Convert(body, controlName, querystring); } return("<?xml:namespace prefix = sc />" + str); }
/// <summary>Gets the URL.</summary> /// <returns>The URL.</returns> /// <contract> /// <requires name="url" condition="not empty" /> /// <requires name="mode" condition="not empty" /> /// <ensures condition="not null" /> /// </contract> public UrlString GetUrl() { this.Handle = Control.GetUniqueID("H"); NameValueCollection querystring = new NameValueCollection(1); if (string.IsNullOrEmpty(this.Url)) { if (this.Disabled || UserOptions.HtmlEditor.ContentEditorMode == UserOptions.HtmlEditor.Mode.Preview) { this.Url = "/sitecore/shell/Controls/TinyMCE Editor/Preview.aspx"; querystring["sc_disableproperties"] = "1"; } else { this.Url = "/sitecore/shell/Controls/TinyMCE Editor/Default.aspx"; } } UrlString url = new UrlString(this.Url); url["da"] = Context.Database.Name; url["id"] = StringUtil.GetString(new string[1] { this.ItemID }); url["ed"] = StringUtil.GetString(new string[1] { this.ID }); url["vs"] = StringUtil.GetString(new string[1] { this.Version }); url["la"] = StringUtil.GetString(new string[1] { this.Language }); url["fld"] = StringUtil.GetString(new string[1] { this.FieldID }); url["so"] = StringUtil.GetString(new string[1] { this.Source }); url["di"] = this.Disabled ? "1" : "0"; url["hdl"] = this.Handle; url["mo"] = this.Mode; url["pe"] = this.IsPageEdit ? "1" : "0"; url["fbd"] = this.ShowInFrameBasedDialog ? "1" : "0"; UIUtil.AddContentDatabaseParameter(url); string body = this.Value; if (body == "__#!$No value$!#__") { body = string.Empty; } if (this.Conversion == TinyMCEEditorUrl.HtmlConversion.DesignTime) { querystring["sc_live"] = "0"; string controlName = string.Empty; if (Settings.HtmlEditor.SupportWebControls) { controlName = "control:IDEHtmlEditorControl"; } body = DesignTimeHtml.Convert(body, controlName, querystring); } else if (this.Conversion == TinyMCEEditorUrl.HtmlConversion.Runtime) { body = RuntimeHtml.Convert(body, Settings.HtmlEditor.SupportWebControls); } HttpContext.Current.Session[this.Handle] = (object)body; return(url); }