Beispiel #1
0
    protected override void OnInit(EventArgs e)
    {
        var showSlugsList = string.Equals(QueryHelper.GetString("subtab", null), PageRoutingUIHelper.SLUGS_LIST_SUBTAB_NAME, StringComparison.InvariantCultureIgnoreCase);

        if (showSlugsList)
        {
            URLHelper.Redirect(URLHelper.ResolveUrl(PageRoutingUIHelper.GetSlugsListingPath(Node.NodeID, Node.DocumentCulture)));
        }

        DocumentManager.RegisterEvents    = false;
        DocumentManager.UseDocumentHelper = false;
        DocumentManager.CheckPermissions  = false;

        base.OnInit(e);

        // Enable split mode
        EnableSplitMode = true;

        // Register the scripts
        ScriptHelper.RegisterLoader(Page);

        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.Content", "Properties.URLs"))
        {
            RedirectToUIElementAccessDenied("CMS.Content", "Properties.URLs");
        }

        pnlAlternativeUrls.Visible = AlternativeUrlHelper.IsAlternativeUrlUIEnabled(Node.NodeSiteID);
        pnlPageUrlPath.Visible     = pnlContainer.Visible = PageRoutingHelper.GetRoutingMode(Node.NodeSiteID) == PageRoutingModeEnum.BasedOnContentTree;

        // Hide option to view all slugs when only one culture is assigned to the site
        btnDisplaySlugs.Visible = Node.Site.HasMultipleCultures;

        ScriptHelper.RegisterModule(this, "CMS/Clamp", new
        {
            elementWithTextSelector = ".static-textpanel"
        });
    }
Beispiel #2
0
    private void SetPreviewLinks()
    {
        string liveUrl = DocumentURLProvider.GetAbsoluteUrl(Node);

        if (string.IsNullOrEmpty(liveUrl) && PageRoutingHelper.GetRoutingMode(Node.NodeSiteID) == PageRoutingModeEnum.Custom)
        {
            litMissingPattern.Visible = true;
        }

        if (!string.IsNullOrEmpty(liveUrl))
        {
            plcLive.Visible      = true;
            lnkLiveURL.HRef      = liveUrl;
            lnkLiveURL.InnerText = liveUrl;
        }

        var previewUrl = Node.GetPreviewLink(CurrentUser.UserGUID);

        if (!string.IsNullOrEmpty(previewUrl))
        {
            plcPreview.Visible                = true;
            btnResetPreviewGuid.ToolTip       = GetString("content.ui.properties.invalidatepreviewurl");
            btnResetPreviewGuid.Click        += btnResetPreviewGuid_Click;
            btnResetPreviewGuid.OnClientClick = "if(!confirm(" + ScriptHelper.GetLocalizedString("content.ui.properties.generatepreviewurlconf") + ")){return false;}";

            SetPreviewUrl(previewUrl);
        }

        if (MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) != AuthorizationResultEnum.Allowed)
        {
            btnResetPreviewGuid.Enabled  = false;
            btnResetPreviewGuid.CssClass = "Disabled";
        }

        UpdateLiveSiteButtonUrl(liveUrl);
    }