⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managegalleriesadmin.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -