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

using System;
using CommunityServer.Controls;

namespace CommunityServer.ControlPanel.Controls
{
	public abstract class ControlPanelTabDrivenTemplatedWebControl : TabDrivenTemplatedWebControl
	{
		public ControlPanelTabDrivenTemplatedWebControl() : base()
		{
		}

		protected override String ExternalSkinFileName
		{
			get
			{
				return string.Format("/ControlPanel/Skin-{0}.ascx", this.GetType().Name);
			}
		}

		protected override string GetText(Tab t)
		{
			if(t.HasText)
				return t.Text;
			else
				return CommunityServer.ControlPanel.Components.ResourceManager.GetString(t.ResourceName); 
		}

		protected string GetText(Tab t, string url)
		{
				return String.Format(@"<a href=""{0}"" onclick=""event.cancelBubble=true;"">{1}</a>",url, GetText(t));
		}

	}
}
