public static LightHead[] GetTopicTags(ObjectHeadBox tagBox, LightParent topic) { int[] tagIds = topic.AllChildIds(TopicType.TagLinks); List <LightHead> tags = new List <LightHead>(tagIds.Length); foreach (int tagId in tagIds) { if (tagBox.ObjectById.Exist(tagId)) { tags.Add(new LightHead(tagBox, tagId)); } } return(tags.ToArray()); }
public static IHtmlControl GetViewTagsPanel(ObjectHeadBox tagBox, LightParent topic) { List <IHtmlControl> elements = new List <IHtmlControl>(); elements.Add(new HLabel("Теги:").FontBold().MarginRight(5)); int[] tagIds = topic.AllChildIds(TopicType.TagLinks); RowLink[] tagRows = GetTagRows(tagBox, tagIds); //tagsDisplay = StringHlp.Join(", ", tagRows, delegate (RowLink row) // { return TagType.DisplayName.Get(row); } //); foreach (RowLink tagRow in tagRows) { elements.Add( new HLink(TagUrl(tagRow.Get(ObjectType.ObjectId), 0), TagType.DisplayName.Get(tagRow)).MarginRight(5) ); } return(new HPanel( elements.ToArray() ).MarginTop(10)); }