📄 manageblogsadmin.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.Controls;
namespace CommunityServer.Blogs.Controls
{
/// <summary>
/// Summary description for ManageBlogsAdmin.
/// </summary>
public class ManageBlogsAdmin : ManageSectionAdmin
{
public ManageBlogsAdmin()
{
}
protected override string ExternalSkinFileName
{
get {return CreateExternalSkinFileName("Blogs");}
}
protected override void OnLoad(EventArgs e)
{
if(!CSContext.Current.User.IsBlogAdministrator)
throw new CSException(CSExceptionType.AccessDenied,"User does not have access to the blog permissions");
FindControl("WeblogDirectoryWriter").Visible = WeblogConfiguration.Instance().CreateBlogDirectories;
base.OnLoad (e);
}
protected override ControlUserMode GetMode
{
get
{
return ControlUserMode.BlogSystemAdministrator;
}
}
protected override ArrayList GetGroups()
{
return WeblogGroups.GetWeblogGroups(false, true,this.IsEdit);
}
protected override ApplicationType ApplicationType
{
get
{
return ApplicationType.Weblog;
}
}
protected override string TitleResourceName
{
get
{
return "WeblogManage_Description";
}
}
protected override string GroupButtonText()
{
return ResourceManager.GetString("Weblog_CreateBlogGroup");// "Create new weblog group";
}
protected override string GetNewGroupText()
{
return ResourceManager.GetString("Weblog_CreateBlog");
}
protected override string GetAdminSectionLink(int weblogID)
{
Weblog wl = Weblogs.GetWeblog(weblogID,false,true);
return BlogUrls.Instance().AdminSettings_Admin_ReturnUrl(wl.ApplicationKey, "blog_manage", "");
}
protected override Section CreateBlankSection
{
get { return new Weblog(); }
}
protected override string GetAdminGroupLink(int groupID)
{
return BlogUrls.Instance().AdminGroupSettings(groupID);
}
protected override void SetDefaultPermissions(Section createdSection)
{
base.SetDefaultPermissions (createdSection);
if(WeblogConfiguration.Instance().CreateBlogDirectories)
WebDirectory.Create(Globals.GetSiteUrls().Locations["weblogs"] + createdSection.ApplicationKey);
}
protected override bool CheckForDuplicate(string applicationKey)
{
// Check to make sure sure it isn't a duplicate weblog
foreach(Weblog w in Weblogs.GetWeblogs(true, true, false))
if(string.Compare(w.ApplicationKey, applicationKey, true) == 0)
return true;
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -