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

using System.Web;
using CommunityServer.Controls;
using CommunityServer.Galleries.Components;

namespace CommunityServer.ControlPanel.Photos
{
	/// <summary>
	/// Summary description for TagCategorizationValidator.
	/// </summary>
	public class TagCategorizationValidator : IMenuItem
	{
		public bool IsValid(HttpContext context)
		{
			CommunityServer.ControlPanel.UI.BaseGalleryPage page = HttpContext.Current.Handler as CommunityServer.ControlPanel.UI.BaseGalleryPage;
			if (page != null && page.CurrentGallery != null)
				return page.CurrentGallery.CategorizationType == CategorizationType.Tag;
			else
				return false;
		}
	}
}
