//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;

namespace CommunityServer.Blogs.Controls
{
	/// <summary>
	/// Summary description for PostReplyButton.
	/// </summary>
	public class PostReplyButton : HyperLink
	{
		public PostReplyButton()
		{
			//
			// TODO: Add constructor logic here
			//
		}


        private WeblogPost _post = null;
        public WeblogPost Post
        {
            get
            {
                return _post;
            }
            set
            {
                _post = value;
            }
        }

		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender (e);
           
            
            if (Post == null || Post.IsLocked) 
            {
                this.Controls.Clear();
				this.Visible = false;
            }
            else
            {
				this.NavigateUrl = BlogUrls.Instance().CommentsPage(Post.Section.ApplicationKey,Post.PostID);
				this.Text = ResourceManager.GetString("Weblogs_PostAComment");
            }

            //Check Reply permission
            
            

        }

	}
}
