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

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

namespace CommunityServer.Controls 
{
	public class Footer : WebControl 
	{
		CSContext csContext = CSContext.Current;

		protected override void Render(HtmlTextWriter writer)
		{
			if (!Globals.IsNullorEmpty(csContext.SiteSettings.Copyright))
			{
				writer.WriteLine("<div class=\"Copyright\">" + csContext.SiteSettings.Copyright + "</div>");
			}

			if(!(Telligent.Registration.CommunityServer.IsStandard && !csContext.SiteSettings.EnableEula))
			{
				// Removal of copywrite is available also with support options at
				// http://www.telligentsystems.com/Solutions/Forums/
				//
				writer.Write( "<a target=\"_blank\" href=\"http://communityserver.org/r.ashx?1\"><img alt=\"" + string.Format(ResourceManager.GetString("Footer_PoweredBy"), "Community Server") + "\" border=\"0\" src=\"" + Globals.GetSiteUrls().Home + "utility/EULA.GIF" + "\"/></a>");
			}
		}
	}
}
