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

using CommunityServer.Components;
using CommunityServer.Controls;
using CA = ComponentArt.Web.UI;

namespace CommunityServer.Discussions.Components
{
	/// <summary>
	/// Can be used to render a link to each forum group on the TabBar
	/// </summary>
	public class ForumGroupBar : INavigationBarItem
	{
		#region INavigationBarItem Members

		public void Process(NavigationBar nb, CA.BaseMenuItem bmi, bool isSelected)
		{
			if(isSelected)
			{
				foreach(Group g in ForumGroups.GetForumGroups(true,false))
				{
					CA.BaseMenuItem child = nb.CreateMenuItem;
					child.Text = g.Name;
					child.NavigateUrl = Globals.GetSiteUrls().ForumGroup(g.GroupID);
					nb.AddMenuItem(bmi,child);
				}
				
			}
		}

		#endregion

	}
}