using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CMS.CMSHelper; using CMS.GlobalHelper; using CMS.PortalControls; public partial class CMSWebParts_Blogs_BlogComment : CMSAbstractWebPart { #region "Properties" /// /// Gets or sets the site name. If is empty, documents from all sites are displayed. /// public string SiteName { get { return ValidationHelper.GetString(GetValue("SiteName"), String.Empty).Replace("##currentsite##", CMSContext.CurrentSiteName); } set { SetValue("SiteName", value); } } /// /// Gets or sets the order by condition. /// public string OrderBy { get { return ValidationHelper.GetString(GetValue("OrderBy"), "ReportWhen"); } set { SetValue("OrderBy", value); } } /// /// Gets or sets the sorting direction. /// public string Sorting { get { return ValidationHelper.GetString(GetValue("Sorting"), "ASC"); } set { SetValue("Sorting", value); } } /// /// Gets or sets the value of items per page. /// public string ItemsPerPage { get { return ValidationHelper.GetString(GetValue("ItemsPerPage"), "25"); } set { SetValue("ItemsPerPage", value); } } /// /// Indicates whether displayed comment is approved. /// public string IsApproved { get { return ValidationHelper.GetString(GetValue("IsApproved"), "no"); } set { SetValue("IsApproved", value); } } /// /// Indicates whether displayed comment is spam. /// public string IsSpam { get { return ValidationHelper.GetString(GetValue("IsSpam"), "all"); } set { SetValue("IsSpam", value); } } /// /// Blog name filter. /// public string BlogName { get { return ValidationHelper.GetString(GetValue("BlogName"), "##myblogs##"); } set { SetValue("BlogName", value); } } /// /// Returns true if the control processing should be stopped. /// public override bool StopProcessing { get { return base.StopProcessing; } set { base.StopProcessing = value; ucComments.StopProcessing = value; } } #endregion /// /// Content loaded event handler. /// public override void OnContentLoaded() { base.OnContentLoaded(); SetupControl(); } /// /// Initializes control properties. /// protected void SetupControl() { if (StopProcessing) { // Do nothing } else { ucComments.ShowFilter = false; ucComments.BlogName = BlogName; ucComments.IsSpam = IsSpam; ucComments.IsApproved = IsApproved; ucComments.ItemsPerPage = ItemsPerPage; ucComments.OrderBy = OrderBy + " " + Sorting; ucComments.SiteName = SiteName; } } }