📄 defaultpostsettings.aspx.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Blogs.Controls;
using CommunityServer.Components;
using CommunityServer.ControlPanel.Controls;
using CommunityServer.ControlPanel.UI;
using CommunityServer.Controls;
using ResourceControl = CommunityServer.ControlPanel.Controls.ResourceControl;
using ResourceLinkButton = CommunityServer.ControlPanel.Controls.ResourceLinkButton;
using ResourceManager = CommunityServer.ControlPanel.Components.ResourceManager;
namespace CommunityServer.ControlPanel.Blogs
{
public class DefaultPostSettings : BaseBlogPage
{
#region Child Controls
protected ResourceLinkButton SaveButton;
protected ConfigOKStatusMessage Status;
protected YesNoRadioButtonList ynEnableReplies;
protected CommentModerationDropDownList ModerationDDL;
protected FeedbackNotificationDropDownList NotificationType;
protected YesNoRadioButtonList ynEnableRatings;
protected YesNoRadioButtonList ynEnableTrackbacks;
protected YesNoRadioButtonList ynAggregatePost;
protected YesNoRadioButtonList ynCommunity;
protected YesNoRadioButtonList ynSyndicateExcerpt;
protected YesNoRadioButtonList ynEnableCrossPostingDefault;
protected ControlPanelSelectedNavigation SelectedNavigation1;
protected HtmlTableRow CrossPostingRow;
protected YesNoRadioButtonList ynAutoName;
#endregion
override protected void OnInit(EventArgs e)
{
this.SaveButton.Click += new EventHandler(this.SaveButton_Click);
this.Load += new EventHandler(this.Page_Load);
base.OnInit(e);
}
private void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!WeblogConfiguration.Instance().EnableCrossPosting)
CrossPostingRow.Visible = false;
ynEnableReplies.SelectedValue = CurrentWeblog.EnableCommentsDefault;
ynEnableRatings.SelectedValue = CurrentWeblog.EnableRatingsDefault;
ynEnableTrackbacks.SelectedValue = CurrentWeblog.EnableTrackbacksDefault;
ynAggregatePost.SelectedValue = CurrentWeblog.EnablePostAggregationDefault;
ynCommunity.SelectedValue = CurrentWeblog.EnableCommunityParticipationDefault;
ynSyndicateExcerpt.SelectedValue = CurrentWeblog.SyndicateExcerptDefault;
ynEnableCrossPostingDefault.SelectedValue = CurrentWeblog.EnableCrossPostingDefault;
ListItem li = ModerationDDL.Items.FindByValue(CurrentWeblog.ModerationTypeDefault.ToString());
if (li != null)
li.Selected = true;
NotificationType.SelectedValue = CurrentWeblog.FeedbackNotificationType;
ynAutoName.SelectedValue = CurrentWeblog.AutoNamePosts;
}
}
private void SaveButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
CurrentWeblog.EnableCommentsDefault = ynEnableReplies.SelectedValue;
CurrentWeblog.EnableRatingsDefault = ynEnableRatings.SelectedValue;
CurrentWeblog.EnableTrackbacksDefault = ynEnableTrackbacks.SelectedValue;
CurrentWeblog.EnablePostAggregationDefault = ynAggregatePost.SelectedValue;
CurrentWeblog.EnableCommunityParticipationDefault = ynCommunity.SelectedValue;
CurrentWeblog.SyndicateExcerptDefault = ynSyndicateExcerpt.SelectedValue;
CurrentWeblog.EnableCrossPostingDefault = ynEnableCrossPostingDefault.SelectedValue;
CurrentWeblog.ModerationTypeDefault = (CommentModerationType)Enum.Parse(typeof(CommentModerationType), ModerationDDL.SelectedValue);
CurrentWeblog.FeedbackNotificationType = NotificationType.SelectedValue;
CurrentWeblog.AutoNamePosts = ynAutoName.SelectedValue;
Weblogs.Update(CurrentWeblog);
Status.Success = true;
Status.Visible = true;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -