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

📄 descoptions.aspx.cs

📁 community server 源码
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.Components;
using CommunityServer.Blogs.Components;
using CommunityServer.ControlPanel.Components;
using CommunityServer.ControlPanel.Controls;
using CommunityServer.ControlPanel.UI;
using CommunityServer.Controls;
using ResourceManager = CommunityServer.ControlPanel.Components.ResourceManager;
using ResourceLinkButton = CommunityServer.ControlPanel.Controls.ResourceLinkButton;

namespace CommunityServer.ControlPanel.Blogs
{
	/// <summary>
	/// Summary description for PostEditorPage.
	/// </summary>
	public class DescriptiveOptionsPage : BaseBlogPage
	{
        protected RequiredFieldValidator TitleValidator;
        protected TextBox Title;
        protected TextBox Description;
        protected TextBox News;
		protected TextBox MetaTagDescription;
		protected TextBox MetaTagKeywords;
		protected TextBox RawHTMLHeader;
		protected PlaceHolder RawHTMLPanel;
		protected ResourceLinkButton SaveButton;
		protected ConfigOKStatusMessage Status;
	
		private void Page_Load(object sender, EventArgs e)
		{
			if(!IsPostBack)
			{
				TitleValidator.Text = ResourceManager.GetString("CP_Blogs_DescOptions_BlogTitle_Required");
			    Title.Text = this.CurrentWeblog.Name;
                Description.Text = this.CurrentWeblog.Description;
                News.Text = this.CurrentWeblog.News;
				MetaTagDescription.Text = this.CurrentWeblog.MetaTagDescription;
				MetaTagKeywords.Text = this.CurrentWeblog.MetaTagKeywords;

				if (WeblogConfiguration.Instance().EnableRawHeadEditing)
					RawHTMLHeader.Text = this.CurrentWeblog.RawAdditionalHeader;
				else
					RawHTMLPanel.Visible = false;
			}
		}

		override protected void OnInit(EventArgs e)
		{
			this.Load += new EventHandler(this.Page_Load);
			base.OnInit(e);
			this.SaveButton.Click += new EventHandler(this.SaveButton_Click);
		}

        private void SaveButton_Click(object sender, EventArgs e)
        {
            if(Page.IsValid)
            {
                CurrentWeblog.Name = Title.Text;
                CurrentWeblog.Description = Description.Text;
                CurrentWeblog.News = News.Text;
				CurrentWeblog.MetaTagDescription = Transforms.StripHtmlXmlTags(MetaTagDescription.Text);
				CurrentWeblog.MetaTagKeywords = Transforms.StripHtmlXmlTags(MetaTagKeywords.Text);
				
				if (WeblogConfiguration.Instance().EnableRawHeadEditing)
					CurrentWeblog.RawAdditionalHeader = RawHTMLHeader.Text;

            	Weblogs.Update(CurrentWeblog);
				
				Status.Success = true;
				Status.Visible = true;
            }
        }
	}
}

⌨️ 快捷键说明

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