Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CMSPage page = Parent.Page as CMSPage;

        var developmentMode = (page != null) ? page.CurrentMaster.DevelopmentMode : SystemContext.DevelopmentMode;

        if (developmentMode && MembershipContext.AuthenticatedUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.GlobalAdmin))
        {
            // UI Element
            var elem = UIContext.UIElement;
            if (elem != null)
            {
                ltlActions.Text += UIContextHelper.GetResourceUIElementsLink(elem.ElementResourceID, elem.ElementID);
            }

            // Debug
            string urlDebug  = URLHelper.GetAbsoluteUrl("~/CMSModules/System/Debug/System_ViewRequest.aspx?guid=" + DebugContext.CurrentRequestLogs.RequestGUID);
            string textDebug = GetString("general.debug");
            ltlDebug.Text = String.Format("<a target=\"_blank\" href=\"{0}\">{1}</a>", urlDebug, UIHelper.GetAccessibleIconTag("icon-bug", textDebug, FontIconSizeEnum.Standard));

            // Localize
            string textLocalize = GetString("localizable.localize");
            ltlLocalize.Text          = UIHelper.GetAccessibleIconTag("icon-earth", textLocalize, FontIconSizeEnum.Standard);
            btnLocalize.Image.Visible = false;

            // Do not move to the markup - could cause life cycle issues
            btnLocalize.HorizontalPosition  = CMS.ExtendedControls.HorizontalPositionEnum.Right;
            btnLocalize.OffsetY             = -20;
            btnLocalize.OffsetX             = 1;
            btnLocalize.MouseButton         = CMS.ExtendedControls.MouseButtonEnum.Both;
            btnLocalize.ContextMenuCssClass = "dev-tools-context-menu";
            btnLocalize.MenuControlPath     = "~/CMSAdminControls/UI/Development/Localize.ascx";
        }
        else
        {
            Visible = false;
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CMSPage page = Parent.Page as CMSPage;

        var developmentMode = (page != null) ? page.CurrentMaster.DevelopmentMode : SystemContext.DevelopmentMode;

        if (developmentMode && MembershipContext.AuthenticatedUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.GlobalAdmin))
        {
            // Debug
            lnkDebug.NavigateUrl = "~/CMSModules/System/Debug/System_ViewRequest.aspx?guid=" + DebugContext.CurrentRequestLogs.RequestGUID;

            // UI Element
            var elem = UIContext.UIElement;
            if (elem != null)
            {
                ltlActions.Text += UIContextHelper.GetResourceUIElementsLink(elem.ElementResourceID, elem.ElementID);
            }

            // Localization
            btnLocalize.Image.ImageUrl         = GetImageUrl("Objects/CMS_Culture/list.png");
            btnLocalize.Image.CausesValidation = false;

            imgDebug.ImageUrl = GetImageUrl("CMSModules/CMS_System/debug.png");
            imgDebug.ToolTip  = imgDebug.AlternateText = GetString("Administration-System.Debug");

            // Do not move to the markup - could cause life cycle issues
            btnLocalize.HorizontalPosition  = CMS.ExtendedControls.HorizontalPositionEnum.Right;
            btnLocalize.OffsetY             = -20;
            btnLocalize.OffsetX             = 1;
            btnLocalize.MouseButton         = CMS.ExtendedControls.MouseButtonEnum.Both;
            btnLocalize.ContextMenuCssClass = "DevToolsContextMenu";
            btnLocalize.MenuControlPath     = "~/CMSAdminControls/UI/Development/Localize.ascx";
        }
        else
        {
            Visible = false;
        }
    }