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/RMourik/bassol.nl/wwwroot/CMSModules/Modules/Pages/Settings/Tree.aspx.cs
using System;
using System.Linq;
using System.Text;

using CMS.Helpers;
using CMS.DataEngine;
using CMS.UIControls;

public partial class CMSModules_Modules_Pages_Settings_Tree : GlobalAdminPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!URLHelper.IsPostback())
        {
            treeSettings.SelectPath = "/";

            int categoryId = QueryHelper.GetInteger("categoryid", -1);
            SettingsCategoryInfo category = SettingsCategoryInfoProvider.GetSettingsCategoryInfo(categoryId);
            // Select requested category
            if (category != null)
            {
                treeSettings.SelectPath = category.CategoryIDPath;
                treeSettings.CategoryID = category.CategoryID;
                treeSettings.ParentID = category.CategoryParentID;
                treeSettings.CategoryModuleID = category.CategoryResourceID;
                treeSettings.Value = category.CategoryID + "|" + category.CategoryParentID;
            }
            else
            {
                //  Select root
                SettingsCategoryInfo rootCat = treeSettings.RootCategory;
                if (rootCat != null)
                {
                    treeSettings.CategoryID = rootCat.CategoryID;
                    treeSettings.ParentID = rootCat.CategoryParentID;
                    treeSettings.Value = rootCat.CategoryID + "|" + rootCat.CategoryParentID;
                }
            }
        }
    }
}