HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/TDijk1/erp-apps.eu/wwwroot/CMSModules/Forums/Tools/Forums/Forum_New.aspx.cs
using System;

using CMS.Core;
using CMS.Forums;
using CMS.Helpers;
using CMS.PortalEngine;
using CMS.UIControls;

[UIElement(ModuleName.FORUMS, "NewForum")]
public partial class CMSModules_Forums_Tools_Forums_Forum_New : CMSForumsPage
{
    private int groupId = 0;


    protected void Page_Load(object sender, EventArgs e)
    {
        groupId = QueryHelper.GetInteger("parentobjectid", 0);

        ForumContext.CheckSite(groupId, 0, 0);

        forumNew.GroupID = groupId;
        forumNew.OnSaved += new EventHandler(forumNew_OnSaved);
        forumNew.IsLiveSite = false;

        InitializeMasterPage();
    }


    protected void forumNew_OnSaved(object sender, EventArgs e)
    {
        string url = UIContextHelper.GetElementUrl("cms.forums", "EditForum", false);
        url = URLHelper.AddParameterToUrl(url, "objectid", forumNew.ForumID.ToString());
        url = URLHelper.AddParameterToUrl(url, "parentobjectid", groupId.ToString());
        URLHelper.Redirect(url);
    }


    /// <summary>
    /// Initializes Master Page.
    /// </summary>
    protected void InitializeMasterPage()
    {
        // Initialize help 
        Title = "Forums - New forum";

        // Initialize breadcrumbs
        PageBreadcrumbs.Items.Add(new BreadcrumbItem()
        {
            Text = GetString("forum_list.headercaption"),
            RedirectUrl = URLHelper.AddParameterToUrl(UIContextHelper.GetElementUrl("cms.forums", "ForumGroupEditTab_Forums", false), "parentobjectid", groupId.ToString()),
        });
        PageBreadcrumbs.Items.Add(new BreadcrumbItem()
        {
            Text = GetString("Forum_Edit.NewForum"),
        });
    }
}