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/CMSInlineControls/DocumentAttachments.ascx.cs
using System;
using CMS.DataEngine;
using CMS.DocumentEngine;
using CMS.ExtendedControls;
using CMS.PortalEngine;
using CMS.Base;
using CMS.SiteProvider;

public partial class CMSInlineControls_DocumentAttachments : InlineUserControl
{
    #region "Methods"

    protected void Page_Load(object sender, EventArgs e)
    {
        TreeNode currentDocument = DocumentContext.CurrentDocument;
        if (currentDocument != null)
        {
            // Get document type transformation
            string transformationName = currentDocument.NodeClassName + ".attachment";
            TransformationInfo ti = TransformationInfoProvider.GetTransformation(transformationName);
            // If transformation not present, use default from the Root document type
            if (ti == null)
            {
                transformationName = "cms.root.attachment";
                ti = TransformationInfoProvider.GetTransformation(transformationName);
            }

            if (ti == null)
            {
                throw new Exception("[DocumentAttachments]: Default transformation '" + transformationName + "' doesn't exist!");
            }

            ucAttachments.TransformationName = transformationName;
            ucAttachments.SiteName = SiteContext.CurrentSiteName;
            ucAttachments.Path = currentDocument.NodeAliasPath;
            ucAttachments.CultureCode = currentDocument.DocumentCulture;
            ucAttachments.OrderBy = "AttachmentOrder, AttachmentName";
            ucAttachments.PageSize = 0;
            ucAttachments.GetBinary = false;
            ucAttachments.CacheMinutes = SettingsKeyInfoProvider.GetIntValue(SiteContext.CurrentSite + ".CMSCacheMinutes");
        }
    }

    #endregion
}