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

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

namespace CommunityServer.ControlPanel.Controls
{
	/// <summary>
	/// Summary description for CurrentFileFolder.
	/// </summary>
	public class CurrentFileFolder : Control
	{
		public CurrentFileFolder()
		{
		
		}

		protected override void Render(HtmlTextWriter writer)
		{
			BaseFilesPage FilesPage = this.Page as BaseFilesPage;
			Folder f = FilesPage.CurrentFolder;
			if(f != null)
			{
				HyperLink link = new HyperLink();
				link.Text = f.Name;
				link.NavigateUrl = FileGalleryUrls.Instance().ViewFolder(f.ApplicationKey);
				link.RenderControl(writer);
			}
			else
			{
				writer.Write("Unknown");
			}
		}
	}
}
