using System; using CMS.Forums; public partial class CMSModules_Forums_Controls_Layouts_Tree_Forums : ForumViewer { /// /// Load data. /// protected override void OnLoad(EventArgs e) { ReloadData(); base.OnLoad(e); } /// /// Reloads the data of the forum control. /// public override void ReloadData() { base.ReloadData(); ForumContext.GroupID = GroupID; // Create where condition reflecting permissions string where = ""; if (HideForumForUnauthorized) { where = ForumInfoProvider.CombineSecurityWhereCondition("(ForumOpen = 1) AND (ForumGroupID = " + GroupID + ")", CommunityGroupID); } else { where = "(ForumOpen = 1) AND (ForumGroupID = " + GroupID + ")"; } listForums.OuterData = ForumContext.CurrentGroup; listForums.DataSource = ForumInfoProvider.GetForums(where, "ForumOrder ASC, ForumName ASC", 0, null); listForums.DataBind(); } }