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/App_Code/Pux/Kentico/Macros/SiteMacroMethods.cs
using CMS;
using CMS.Helpers;
using CMS.MacroEngine;
using CMS.SiteProvider;
using Pux.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

// Makes all methods in the 'CustomMacroMethods' container class available for string objects
[assembly: RegisterExtension(typeof(SiteMacroMethods), typeof(string))]
public class SiteMacroMethods : MacroMethodContainer
{
    [MacroMethod(typeof(string), "Translates given resource string using EBIZ resource strings.", 1)]
    [MacroMethodParam(0, "resourceStringKey", typeof(string), "Name of the resource string.")]
    public static object GetSiteResourceString(EvaluationContext context, params object[] parameters)
    {
        if (parameters.Length < 1)
        {
            throw new NotSupportedException();
        }

        var stringKey = parameters[0] as string;

        return TextTools.GetSiteResourceString(stringKey);
    }
}