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

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CommunityServer.Components;
using System.IO;
using CommunityServer.Controls;
using CommunityServer.Discussions.Components;

namespace CommunityServer.Discussions.Controls 
{
	// *********************************************************************
	//  PostPendingModeration
	//
	/// <summary>
	/// Displayed to user after they post a message to the forums if they are moderated
	/// </summary>
	// ********************************************************************/ 
    public class PostPendingModeration : TemplatedWebControl
    {
        #region Child Controls

        Label title;
        Label body;

        //CSContext csContext = CSContext.Current;

        #endregion

        protected override void OnInit(EventArgs e) 
        {
            if (SkinName == null)                
                ExternalSkinFileName = "Skin-PostPendingModeration.ascx";
            else 
                ExternalSkinFileName = SkinName;
			
            base.OnInit(e);
        }
		
        protected override void OnLoad(EventArgs e) 
        {
            if (!Page.IsPostBack)
                DataBind();

            base.OnLoad(e);
        }

        #region DataBind

        public override void DataBind() 
        {
            base.DataBind();

        	CSContext cntx = CSContext.Current;

        	if (title != null) 
                title.Text = ResourceManager.GetString("PostPendingModeration_Title");;

            if (body != null) 
                body.Text = String.Format(ResourceManager.GetString("PostPendingModeration_Body"), "<a href=\"" + ForumUrls.Instance().Forum( cntx.SectionID ) + "\"> " + Forums.GetForum( cntx.SectionID).Name + "</a>");
        }
		
        #endregion		
		
        #region Skin
                
        protected override void AttachChildControls() 
        {					
            title = (Label) FindControl("MessageTitle");
            body = (Label) FindControl("MessageBody");
        }
		
        #endregion
    }
}




