private static void RenderStatus(HtmlTextWriter output, Item contextItem) { output.AddAttribute(HtmlTextWriterAttribute.Class, "scRibbonToolbarText"); output.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "80%"); // setting float, display and vertical-align fixes the default left align of scRibbonToolbarText output.AddStyleAttribute("float", "left"); output.AddStyleAttribute(HtmlTextWriterStyle.Display, "inline-block"); output.AddStyleAttribute(HtmlTextWriterStyle.VerticalAlign, "top"); output.RenderBeginTag(HtmlTextWriterTag.Div); // we want the panel to display only English IEnumerable <PublishStatusInfo> statuses = PublishStatusManager.GetPublishStatus(contextItem, new List <Language> { LanguageManager.GetLanguage("en") }); foreach (PublishStatusInfo status in statuses) { output.RenderBeginTag(HtmlTextWriterTag.Div); RenderSingleStatus(output, status); output.RenderEndTag(); } output.RenderEndTag(); }
protected override void OnLoad(EventArgs e) { Assert.ArgumentNotNull(e, "e"); base.OnLoad(e); if (Context.ClientPage.IsEvent) { return; } Item contextItem = UIUtil.GetItemFromQueryString(Context.ContentDatabase); Assert.IsNotNull(contextItem, "item"); StringBuilder result = new StringBuilder(); IEnumerable <PublishStatusInfo> statuses = PublishStatusManager.GetPublishStatus(contextItem); foreach (var statusForDatabase in statuses.GroupBy(x => x.Database)) { result.Append("<div style='font-weight: bold; padding: 2px 0 0 5px'>"); result.Append(statusForDatabase.Key); result.Append("</div>"); foreach (PublishStatusInfo status in statusForDatabase) { result.Append("<div style='padding: 2px 0 0 10px'>"); result.Append(RenderSingleStatus(status)); result.Append("</div>"); } } Result.Controls.Add(new LiteralControl(result.ToString())); }