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/CMS/CMSModules/OnlineMarketing/Pages/Content/MVTest/List.aspx.cs
using System;

using CMS.ExtendedControls.ActionsConfig;
using CMS.Helpers;
using CMS.Membership;
using CMS.PortalEngine;
using CMS.UIControls;

[Security(Resource = "CMS.MVTest", UIElements = "MVTestListing")]
[UIElement("CMS.MVTest", "MVTestListing")]
public partial class CMSModules_OnlineMarketing_Pages_Content_MVTest_List : CMSMVTestPage
{
    /// <summary>
    /// If true, the items are edited in dialog
    /// </summary>
    private bool EditInDialog
    {
        get
        {
            return listElem.Grid.EditInDialog;
        }
        set
        {
            listElem.Grid.EditInDialog = value;
        }
    }


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

        EditInDialog = QueryHelper.GetBoolean("editindialog", false);
    }
    

    protected void Page_Load(object sender, EventArgs e)
    {
        // Set disabled module info
        ucDisabledModule.SettingsKeys = "CMSAnalyticsEnabled;CMSMVTEnabled;CMSAnalyticsTrackConversions";
        ucDisabledModule.ParentPanel = pnlDisabled;

        InitHeaderActions();
        InitTitle();
    }


    /// <summary>
    /// Initializes header actions.
    /// </summary>
    private void InitHeaderActions()
    {
        if (MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.MVTest", "New"))
        {
            string url = UIContextHelper.GetElementUrl("CMS.MVTest", "New", EditInDialog);

            // Get the alias path of the current node
            if (Node != null)
            {
                // Set NodeID in order to check the access to the document
                listElem.NodeID = Node.NodeID;
                listElem.AliasPath = Node.NodeAliasPath;

                url = URLHelper.AddParameterToUrl(url, "NodeID", Node.NodeID.ToString());
                url = URLHelper.AddParameterToUrl(url, "AliasPath", Node.NodeAliasPath);
            }

            // Set header action
            var action = new HeaderAction
            {
                ResourceName = "CMS.MVTest",
                Permission = "Manage",
                Text = GetString("mvtest.new"),
                RedirectUrl = ResolveUrl(url),
                OpenInDialog = EditInDialog
            };

            CurrentMaster.HeaderActions.AddAction(action);
        }
    }


    /// <summary>
    /// Sets title if not in content.
    /// </summary>
    private void InitTitle()
    {
        if (NodeID <= 0)
        {
            SetTitle(GetString("analytics_codename.mvtests"));
        }
    }
}