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/MBoogaard/oosting-horseriding.com/CMS/CMSAdminControls/Debug/Debug.ascx.cs
using System.Collections.Generic;
using System.Web.UI;

using CMS.Base;
using CMS.Helpers;
using CMS.UIControls;

public partial class CMSAdminControls_Debug_Debug : CMSUserControl
{
    private readonly List<LogControl> logControls = new List<LogControl>();


    protected override void OnInit(System.EventArgs e)
    {
        base.OnInit(e);

        foreach (var debug in DebugHelper.RegisteredDebugs)
        {
            // Check if the debug is enabled for live pages
            if (debug.Live && !string.IsNullOrEmpty(debug.LogControl))
            {
                // Load the debug control
                var log = LoadUserControl(debug.LogControl) as LogControl;
                if (log != null)
                {
                    logControls.Add(log);

                    plcDebugs.Append(log);
                }
            }
        }
      
        ScriptHelper.RegisterModule(this, "CMS/DebugControl", pnlDebugContainer.ClientID);
    }


    protected override void Render(HtmlTextWriter writer)
    {
        // Do not render if nothing is displayed
        foreach (var logControl in logControls)
        {
            if (logControl.Visible)
            {
                base.Render(writer);

                DebugContext.DebugPresentInResponse = true;

                break;
            }
        }
    }
}