using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using EPiServer.Core; using EPiServer.UI.Edit; namespace SuoWeb.PublicWeb.Library.ControlAdapters { public class PropertyStringAdapter : EPiServer.Web.PropertyControls.Adapters.PropertyDataControlAdapter { public int PaddingTop { get; set; } public bool AddDivContainer { get; set; } public bool IsRequired { get; set; } public override void CreateEditControls() { base.CreateEditControls(); EditPanel panel = Page as EditPanel; if (panel != null && string.IsNullOrEmpty(panel.GetCompareToLanguage()) == false) { // We are in the compare languages mode, do not show the help icons. It messes ut the design. return; } string headertext = LanguageManager.Instance.TranslateFallback("/superoffice/plugins/header/help", "Information"); string description = PropertyData.TranslateDescription(); // we only adds the image if the help text is available (set in admin mode) if (string.IsNullOrEmpty(description) == false) { Image imageicon = new Image(); Literal imagetag = new Literal(); imagetag.Text = GetCssStyle(); imageicon.ImageUrl = "/publicweb/images/questionmark.gif"; imageicon.Attributes.Add("title", string.Format( "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[{0}] body=[{1}]", headertext, description)); imageicon.Attributes.Add("style",string.Format("padding-left:3px;padding-top:{0}px;", PaddingTop)); Literal startdiv = new Literal(); Literal enddiv = new Literal(); // if input field is of type Page Reference, we needs to add a div if (AddDivContainer) { startdiv.Text = IsRequired ? "