protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.TopicList); int idThread; if (!int.TryParse(Request["f"], out idThread)) { Response.Redirect("default.aspx"); } var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, idThread); if (thread == null) { Response.Redirect("default.aspx"); } if (thread.TopicCount > 0) { var topicsControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicListControl.ascx") as UserControls.Forum.TopicListControl; topicsControl.SettingsID = ForumManager.Settings.ID; topicsControl.ThreadID = thread.ID; topicsHolder.Controls.Add(topicsControl); } else { var emptyScreenControl = new EmptyScreenControl { ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID), Header = Resources.ForumResource.EmptyScreenTopicCaption, Describe = Resources.ForumResource.EmptyScreenTopicText, ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.TopicCreate, thread) ? String.Format("<a class='linkAddMediumText' href='newpost.aspx?f=" + thread.ID + "&m=0'>{0}</a>", Resources.ForumResource.EmptyScreenTopicLink) : String.Empty }; topicsHolder.Controls.Add(emptyScreenControl); } Utility.RegisterTypeForAjax(typeof(Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(thread.ID); var master = Master as ForumMasterPage; master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID))); //bread crumbs var breadCrumbs = (Master as ForumMasterPage).BreadCrumbs; breadCrumbs.Add(new BreadCrumb { Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx" }); breadCrumbs.Add(new BreadCrumb { Caption = thread.Title }); Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs); }
protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.TopicList); int idThread; if (!int.TryParse(Request["f"], out idThread)) Response.Redirect("default.aspx"); var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, idThread); if (thread == null) Response.Redirect("default.aspx"); if (thread.TopicCount > 0) { var topicsControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicListControl.ascx") as UserControls.Forum.TopicListControl; topicsControl.SettingsID = ForumManager.Settings.ID; topicsControl.ThreadID = thread.ID; topicsHolder.Controls.Add(topicsControl); } else { var emptyScreenControl = new EmptyScreenControl { ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID), Header = Resources.ForumResource.EmptyScreenTopicCaption, Describe = Resources.ForumResource.EmptyScreenTopicText, ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.TopicCreate, thread) ? String.Format("<a class='linkAddMediumText' href='newpost.aspx?f=" + thread.ID + "&m=0'>{0}</a>", Resources.ForumResource.EmptyScreenTopicLink) : String.Empty }; topicsHolder.Controls.Add(emptyScreenControl); } Utility.RegisterTypeForAjax(typeof (Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(thread.ID); var master = Master as ForumMasterPage; master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID))); //bread crumbs var breadCrumbs = (Master as ForumMasterPage).BreadCrumbs; breadCrumbs.Add(new BreadCrumb {Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx"}); breadCrumbs.Add(new BreadCrumb {Caption = thread.Title}); Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs); }
protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.PostList); int idTopic = 0; if (!String.IsNullOrEmpty(Request["t"])) { try { idTopic = Convert.ToInt32(Request["t"]); } catch { idTopic = 0; } } if (idTopic == 0) Response.Redirect("default.aspx"); var topic = ForumDataProvider.GetTopicByID(TenantProvider.CurrentTenantID, idTopic); if (topic == null) Response.Redirect("default.aspx"); var postListControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/PostListControl.ascx") as PostListControl; postListControl.SettingsID = ForumManager.Settings.ID; postListControl.Topic = topic; this.postListHolder.Controls.Add(postListControl); Utility.RegisterTypeForAjax(typeof(Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(topic.ThreadID); var isTopicSubscribe = subscriber.IsTopicSubscribe(topic.ID); var master = this.Master as ForumMasterPage; master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, topic.ThreadID))); master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderTopicSubscription(!isTopicSubscribe, topic.ID))); var breadCrumbs = (this.Master as ForumMasterPage).BreadCrumbs; breadCrumbs.Add(new BreadCrumb() { Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx" }); breadCrumbs.Add(new BreadCrumb() { Caption = topic.ThreadTitle, NavigationUrl = "topics.aspx?f=" + topic.ThreadID.ToString() }); breadCrumbs.Add(new BreadCrumb() { Caption = topic.Title }); this.Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs); }
protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.TopicList); Utility.RegisterTypeForAjax(typeof(ForumEditor), this.Page); int idThread; if (!int.TryParse(Request["f"], out idThread)) { Response.Redirect("default.aspx"); } var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, idThread); if (thread == null) { Response.Redirect("default.aspx"); } if (thread.TopicCount > 0) { var topicsControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicListControl.ascx") as UserControls.Forum.TopicListControl; topicsControl.SettingsID = ForumManager.Settings.ID; topicsControl.ThreadID = thread.ID; topicsHolder.Controls.Add(topicsControl); } else { var emptyScreenControl = new EmptyScreenControl { ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID), Header = Resources.ForumResource.EmptyScreenTopicCaption, Describe = Resources.ForumResource.EmptyScreenTopicText, ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.TopicCreate, thread) ? String.Format("<a class='link underline blue plus' href='newpost.aspx?f=" + thread.ID + "&m=0'>{0}</a>", Resources.ForumResource.EmptyScreenTopicLink) : String.Empty }; topicsHolder.Controls.Add(emptyScreenControl); } Utility.RegisterTypeForAjax(typeof(Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(thread.ID); var subscribeThreadLink = subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID); SubscribeLinkBlock.Text = subscribeThreadLink; //var master = Master as ForumMasterPage; // master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID))); ForumTitle = thread.Title; ForumParentTitle = Resources.ForumResource.ForumsBreadCrumbs; ForumParentURL = "default.aspx"; Title = HeaderStringHelper.GetPageTitle((Master as ForumMasterPage).CurrentPageCaption ?? Resources.ForumResource.AddonName); EnableDelete = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null); var sb = new StringBuilder(); sb.Append("<div id=\"forumsActionsMenuPanel\" class=\"studio-action-panel topics\">"); sb.Append("<ul class=\"dropdown-content\">"); if (EnableDelete) { sb.Append("<li><a class=\"dropdown-item\" href=\"javascript:ForumMakerProvider.DeleteThreadTopic('" + thread.ID + "','" + thread.CategoryID + "');\">" + Resources.ForumResource.DeleteButton + "</a></li>"); } sb.Append("</ul>"); sb.Append("</div>"); topicsHolder.Controls.Add(new Literal { Text = sb.ToString() }); SubscribeStatus = isThreadSubscribe ? "subscribed" : "unsubscribed"; }
protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.PostList); int idTopic = 0; if (!String.IsNullOrEmpty(Request["t"])) { try { idTopic = Convert.ToInt32(Request["t"]); } catch { idTopic = 0; } } if (idTopic == 0) { Response.Redirect("default.aspx"); } var topic = ForumDataProvider.GetTopicByID(TenantProvider.CurrentTenantID, idTopic); if (topic == null) { Response.Redirect("default.aspx"); } var postListControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/PostListControl.ascx") as PostListControl; postListControl.SettingsID = ForumManager.Settings.ID; postListControl.Topic = topic; this.postListHolder.Controls.Add(postListControl); Utility.RegisterTypeForAjax(typeof(Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(topic.ThreadID); var isTopicSubscribe = subscriber.IsTopicSubscribe(topic.ID); var master = this.Master as ForumMasterPage; master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, topic.ThreadID))); master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderTopicSubscription(!isTopicSubscribe, topic.ID))); var breadCrumbs = (this.Master as ForumMasterPage).BreadCrumbs; breadCrumbs.Add(new BreadCrumb() { Caption = Resources.ForumResource.ForumsBreadCrumbs, NavigationUrl = "default.aspx" }); breadCrumbs.Add(new BreadCrumb() { Caption = topic.ThreadTitle, NavigationUrl = "topics.aspx?f=" + topic.ThreadID.ToString() }); breadCrumbs.Add(new BreadCrumb() { Caption = topic.Title }); this.Title = HeaderStringHelper.GetPageTitle(Resources.ForumResource.AddonName, breadCrumbs); }
protected void Page_Load(object sender, EventArgs e) { ForumManager.Instance.SetCurrentPage(ForumPage.TopicList); Utility.RegisterTypeForAjax(typeof(ForumEditor), this.Page); int idThread; if (!int.TryParse(Request["f"], out idThread)) Response.Redirect("default.aspx"); var thread = ForumDataProvider.GetThreadByID(TenantProvider.CurrentTenantID, idThread); if (thread == null) Response.Redirect("default.aspx"); if (thread.TopicCount > 0) { var topicsControl = LoadControl(ForumManager.Settings.UserControlsVirtualPath + "/TopicListControl.ascx") as UserControls.Forum.TopicListControl; topicsControl.SettingsID = ForumManager.Settings.ID; topicsControl.ThreadID = thread.ID; topicsHolder.Controls.Add(topicsControl); } else { var emptyScreenControl = new EmptyScreenControl { ImgSrc = WebImageSupplier.GetAbsoluteWebPath("forums_icon.png", ForumManager.Settings.ModuleID), Header = Resources.ForumResource.EmptyScreenTopicCaption, Describe = Resources.ForumResource.EmptyScreenTopicText, ButtonHTML = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.TopicCreate, thread) ? String.Format("<a class='link underline blue plus' href='newpost.aspx?f=" + thread.ID + "&m=0'>{0}</a>", Resources.ForumResource.EmptyScreenTopicLink) : String.Empty }; topicsHolder.Controls.Add(emptyScreenControl); } Utility.RegisterTypeForAjax(typeof(Subscriber)); var subscriber = new Subscriber(); var isThreadSubscribe = subscriber.IsThreadSubscribe(thread.ID); var subscribeThreadLink = subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID); SubscribeLinkBlock.Text = subscribeThreadLink; //var master = Master as ForumMasterPage; // master.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(subscriber.RenderThreadSubscription(!isThreadSubscribe, thread.ID))); ForumTitle = thread.Title; ForumParentTitle = Resources.ForumResource.ForumsBreadCrumbs; ForumParentURL = "default.aspx"; Title = HeaderStringHelper.GetPageTitle((Master as ForumMasterPage).CurrentPageCaption ?? Resources.ForumResource.AddonName); EnableDelete = ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null); var sb = new StringBuilder(); sb.Append("<div id=\"forumsActionsMenuPanel\" class=\"studio-action-panel topics\">"); sb.Append("<div class=\"corner-top left\"></div>"); sb.Append("<ul class=\"dropdown-content\">"); if (EnableDelete) { sb.Append("<li><a class=\"dropdown-item\" href=\"javascript:ForumMakerProvider.DeleteThreadTopic('" + thread.ID + "','" + thread.CategoryID + "');\">" + Resources.ForumResource.DeleteButton + "</a></li>"); } sb.Append("</ul>"); sb.Append("</div>"); topicsHolder.Controls.Add(new Literal { Text = sb.ToString() }); SubscribeStatus = isThreadSubscribe ? "subscribed" : "unsubscribed"; }