private void BuildReplyLinkUI(Forum forum, Message post) { if (forum.HasAccess(ForumApplication.Instance.CurrentUser, Permission.Rights.Reply)) { string replyLink = ForumApplication.Instance.GetLink( SharePointForumControls.UpdateMessage, "topic={0}&{1}={2}&message={3}", post.TopicId, ForumConstants.Query_PostMethod, PostMode.Reply, post.Id); Controls.Add(new LiteralControl( String.Format("<a href=\"{0}\">{1}</a> | ", replyLink, this.WebPartParent.LoadResource("Text.Reply")))); } }
private void BuildEditLinkUI(Forum forum, Message post) { bool canEdit = false; if (ForumApplication.Instance.CurrentUser.IsAdmin) { canEdit = true; } else { if (forum.HasAccess(ForumApplication.Instance.CurrentUser, Permission.Rights.Edit) && post.Author.Id == ForumApplication.Instance.CurrentUser.Id) canEdit = true; } if (canEdit) { string editLink = ForumApplication.Instance.GetLink( SharePointForumControls.UpdateMessage, "message={0}&{1}={2}", post.Id, ForumConstants.Query_PostMethod, PostMode.Edit); Controls.Add(new LiteralControl(string.Format("<a href={0}>{1}</a> | ", editLink, this.WebPartParent.LoadResource("Text.Edit")))); } }
private void BuildQuoteLinkUI(Forum forum, Message post) { bool canQuote = false; if (forum.HasAccess(ForumApplication.Instance.CurrentUser, Permission.Rights.Reply)) { canQuote = true; } if (canQuote) { string quoteLink = ForumApplication.Instance.GetLink( SharePointForumControls.UpdateMessage, "message={0}&{1}={2}", post.Id, ForumConstants.Query_PostMethod, PostMode.Quote); Controls.Add(new LiteralControl(string.Format("<a href={0}>{1}</a> ", quoteLink, this.WebPartParent.LoadResource("Text.Quote")))); } }