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/Objects/Dialogs/ViewObjectVersion.aspx.cs
using System;
using CMS.DataEngine;
using CMS.Helpers;
using CMS.Base;
using CMS.Synchronization;
using CMS.UIControls;

// Set default page title
public partial class CMSModules_Objects_Dialogs_ViewObjectVersion : CMSObjectVersioningPage
{
    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);

        SetCulture();

        // Check hash
        if (!QueryHelper.ValidateHash("hash"))
        {
            RedirectToAccessDenied(ResHelper.GetString("dialogs.badhashtitle"));
        }
    }


    protected void Page_Load(object sender, EventArgs e)
    {
        // Even thought this page uses dialog master page, it always opens in new tab
        PageTitle.IsDialog = false;

        bool noCompare = ValidationHelper.GetBoolean(QueryHelper.GetString("nocompare", string.Empty), false);
        // Initialize view version control
        viewVersion.NoComparison = noCompare;
        int versionId = ValidationHelper.GetInteger(QueryHelper.GetString("versionhistoryid", string.Empty), 0);
        viewVersion.VersionCompareID = ValidationHelper.GetInteger(QueryHelper.GetString("comparehistoryid", string.Empty), 0);

        // Get version to initialize title
        ObjectVersionHistoryInfo version = ObjectVersionHistoryInfoProvider.GetVersionHistoryInfo(versionId);
        if (version != null)
        {
            string objectType = version.VersionObjectType;
            string objType = GetString("ObjectType." + objectType.Replace(".", "_"));
            string title = String.Format(GetString("objectversioning.viewversion.title"), objType, HTMLHelper.HTMLEncode(ResHelper.LocalizeString(version.VersionObjectDisplayName)));
            // Set title
            SetTitle(title);

            viewVersion.Version = version;

            // Exclude site binding table data
            GeneralizedInfo infoObj = ModuleManager.GetReadOnlyObject(objectType);
            viewVersion.ExcludedTableNames = DataClassInfoProvider.GetTableName(infoObj.TypeInfo.SiteBindingObject);
        }

        // Set what data should be displayed
        bool showAll = ValidationHelper.GetBoolean(QueryHelper.GetBoolean("showall", false), false);
        viewVersion.ObjectDataOnly = !showAll;
    }
}