コード例 #1
0
ファイル: BaseForumControl.cs プロジェクト: bsimser/spforums
		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>&nbsp;|&nbsp;", replyLink, 
						this.WebPartParent.LoadResource("Text.Reply"))));
			}
		}
コード例 #2
0
ファイル: BaseForumControl.cs プロジェクト: bsimser/spforums
		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>&nbsp;|&nbsp;", editLink,
					this.WebPartParent.LoadResource("Text.Edit"))));
			}
		}
コード例 #3
0
ファイル: BaseForumControl.cs プロジェクト: bsimser/spforums
		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>&nbsp;", 
					quoteLink, this.WebPartParent.LoadResource("Text.Quote"))));
			}
		}