managegalleriesadmin.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 117 行

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

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

namespace CommunityServer.Galleries.Controls
{

	public class ManageGalleriesAdmin : ManageSectionAdmin
	{
		
		protected override String ExternalSkinFileName
		{
			get { return  CreateExternalSkinFileName("Galleries"); }
		}

		protected override ControlUserMode GetMode
		{
			get { return ControlUserMode.GallerySystemAdministrator; }
		}

		protected override ArrayList GetGroups()
		{
			return Galleries.GetGalleryGroups(false, true, this.IsEdit);
		}

		protected override ApplicationType ApplicationType
		{
			get { return ApplicationType.Gallery; }
		}

		protected override string TitleResourceName
		{
			get { return "ManageGalleries_Description"; }
		}

		protected override string GroupButtonText()
		{
			return ResourceManager.GetString("ManageGalleries_CreateGroup");
		}

		protected override string GetAdminSectionLink(int SectionID)
		{
			return GalleryUrls.Instance().Admin_AdminGallery(SectionID);
		}

		protected override Section CreateBlankSection
		{
			get { return new Gallery(); }
		}

		protected override void CreateNewSection(string sectionName, string owners, int sectionGroupID)
		{
			// Empty string checking
			//
			if ( sectionName == null || sectionName.Trim() == "" ) 
			{
				DataBindGroups();
				return;
			}

			// Get the new Section
			Gallery gallery = GetNewSection(sectionName, sectionGroupID) as Gallery;
			
			// Make sure it wasn't a duplicate
			if(gallery == null)
			{
				DataBindGroups();
				return;
			}
			
			// Continue creating
			gallery.Owners = owners;
			gallery.SectionID = Galleries.AddGallery(gallery);
			SetDefaultPermissions(gallery);
			IsEdit = true;
			DataBindGroups();
		}

		/// <summary>
		/// Returns the path/url to the Gallery Group Admin
		/// </summary>
		protected override string GetAdminGroupLink(int groupID)
		{
			return GalleryUrls.Instance().Admin_GroupAdmin(groupID);
		}

		protected override string GetNewGroupText()
		{
			return ResourceManager.GetString("ManageGalleries_Create");
		}

		protected override void SetDefaultPermissions(Section createdSection)
		{
			base.SetDefaultPermissions(createdSection);
			WebDirectory.Create(Globals.GetSiteUrls().Locations["galleries"] + createdSection.ApplicationKey);
		}

		protected override bool CheckForDuplicate(string applicationKey)
		{
			// Check to make sure sure it isn't a duplicate gallery
			foreach(Gallery g in Galleries.GetGalleries())
				if(string.Compare(g.ApplicationKey, applicationKey, true) == 0)
					return true;
			return false;
		}

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?