protected void Page_Load(object sender, EventArgs e)
    {
        SetPropertyTab(TAB_URLS);

        // Set where condition - show nothing when nodeId is zero
        UniGridAlias.WhereCondition = "AliasNodeID = " + NodeID;

        if (Node != null)
        {
            if (Node.NodeAliasPath == "/")
            {
                valAlias.Visible = false;
            }

            // Check modify permissions
            if ((MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied))
            {
                pnlAlias.Enabled = false;
                menuElem.Enabled = false;
                UniGridAlias.GridView.Enabled = false;
                btnNewAlias.Enabled           = false;

                chkCustomExtensions.Enabled = false;
                ctrlURL.Enabled             = false;
            }
            else
            {
                ltlScript.Text = ScriptHelper.GetScript("var node = " + NodeID + "; \n var deleteMsg = '" + GetString("DocumentAlias.DeleteMsg") + "';");

                UniGridAlias.OnAction            += UniGridAlias_OnAction;
                UniGridAlias.OnExternalDataBound += UniGridAlias_OnExternalDataBound;
                btnNewAlias.OnClientClick         = "window.location.replace('" + URLHelper.ResolveUrl("Alias_Edit.aspx?nodeid=" + NodeID) + "'); return false;";
            }

            chkCustomExtensions.Text = GetString("GeneralProperties.UseCustomExtensions");
            valAlias.ErrorMessage    = GetString("GeneralProperties.RequiresAlias");

            lblExtensions.Text = GetString("doc.urls.urlextensions") + ResHelper.Colon;

            if (!isRoot)
            {
                txtAlias.Enabled = !TreePathUtils.AutomaticallyUpdateDocumentAlias(SiteContext.CurrentSiteName);
            }

            if (!RequestHelper.IsPostBack())
            {
                ReloadData();
            }

            ctrlURL.AutomaticURLPath = TreePathUtils.GetUrlPathFromNamePath(Node.DocumentNamePath, Node.NodeLevel, SiteContext.CurrentSiteName);

            // Reflect processing action
            pnlPageContent.Enabled = DocumentManager.AllowSave;
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register the scripts
        ScriptHelper.RegisterLoader(Page);
        ScriptHelper.RegisterTooltip(Page);
        ScriptHelper.RegisterDialogScript(this);

        if ((SiteContext.CurrentSite != null) && (usrOwner != null))
        {
            usrOwner.SetValue("SiteID", SiteContext.CurrentSite.SiteID);
        }

        StringBuilder script = new StringBuilder();

        if (Node != null)
        {
            // Redirect to information page when no UI elements displayed
            if (pnlUIOther.IsHidden && pnlUIOwner.IsHidden && pnlUIAlias.IsHidden)
            {
                RedirectToUINotAvailable();
            }

            if (Node.IsRoot())
            {
                valAlias.Visible = false;
                txtAlias.Enabled = false;
                valAlias.Enabled = false;
            }
            else
            {
                txtAlias.Enabled = !TreePathUtils.AutomaticallyUpdateDocumentAlias(Node.NodeSiteName);
            }

            valAlias.ErrorMessage = GetString("GeneralProperties.RequiresAlias");

            txtAlias.MaxLength = TreePathUtils.MaxAliasLength;

            // Get strings for headings
            headOtherProperties.Text = GetString("GeneralProperties.OtherGroup");

            canEditOwner = (MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.ModifyPermissions) == AuthorizationResultEnum.Allowed);

            ReloadData();
        }

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ModalDialogsToAdvancedSection", script.ToString(), true);

        // Reflect processing action
        pnlContent.Enabled = DocumentManager.AllowSave;
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Set where condition - show nothing when nodeId is zero
        UniGridAlias.WhereCondition = "AliasNodeID = " + NodeID;

        if (Node != null)
        {
            // Hide parts which are not relevant to content only nodes
            if (ShowContentOnlyProperties)
            {
                pnlUIPath.Visible          = false;
                pnlUIExtended.Visible      = false;
                pnlUIDocumentAlias.Visible = false;
                headAlias.Visible          = false;
            }

            if (Node.NodeAliasPath == "/")
            {
                valAlias.Visible = false;
            }

            // Check modify permissions
            if ((MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied))
            {
                pnlAlias.Enabled = false;
                menuElem.Enabled = false;
                UniGridAlias.GridView.Enabled = false;
                btnNewAlias.Enabled           = false;

                chkCustomExtensions.Enabled = false;
                ctrlURL.Enabled             = false;
            }
            else
            {
                ltlScript.Text = ScriptHelper.GetScript("var node = " + NodeID + "; \n var deleteMsg = '" + GetString("DocumentAlias.DeleteMsg") + "';");

                UniGridAlias.OnAction            += UniGridAlias_OnAction;
                UniGridAlias.OnExternalDataBound += UniGridAlias_OnExternalDataBound;
                btnNewAlias.OnClientClick         = "window.location.replace('" + UrlResolver.ResolveUrl("Alias_Edit.aspx?nodeid=" + NodeID) + "'); return false;";
            }

            chkCustomExtensions.Text = GetString("GeneralProperties.UseCustomExtensions");
            valAlias.ErrorMessage    = GetString("GeneralProperties.RequiresAlias");

            lblExtensions.Text = GetString("doc.urls.urlextensions") + ResHelper.Colon;

            txtAlias.MaxLength = TreePathUtils.MaxAliasLength;
            if (!mIsRoot)
            {
                txtAlias.Enabled = !TreePathUtils.AutomaticallyUpdateDocumentAlias(Node.NodeSiteName);
            }

            if (!RequestHelper.IsPostBack())
            {
                ReloadData();
            }

            // Get automatic URL path
            var culture = CultureHelper.GetShortCultureCode(Node.DocumentCulture);
            ctrlURL.AutomaticURLPath = TreePathUtils.GetUniqueUrlPath(Node, culture);

            // Reflect processing action
            pnlPageContent.Enabled = DocumentManager.AllowSave;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UIContext.PropertyTab = PropertyTabEnum.URLs;

        // Set where condition - show nothing when nodeId is zero
        UniGridAlias.WhereCondition = "AliasNodeID = " + NodeID;

        if (Node != null)
        {
            imgNewAlias.ImageUrl         = GetImageUrl("CMSModules/CMS_Content/Properties/adddocumentalias.png");
            imgNewAlias.DisabledImageUrl = GetImageUrl("CMSModules/CMS_Content/Properties/adddocumentaliasdisabled.png");

            if (Node.NodeAliasPath == "/")
            {
                valAlias.Visible = false;
            }

            // Check modify permissions
            if ((CMSContext.CurrentUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied))
            {
                pnlAlias.Enabled = false;
                menuElem.Enabled = false;
                UniGridAlias.GridView.Enabled = false;
                lnkNewAlias.Disabled          = true;
                imgNewAlias.Enabled           = false;

                chkCustomExtensions.Enabled = false;
                ctrlURL.Enabled             = false;
            }
            else
            {
                ltlScript.Text = ScriptHelper.GetScript("var node = " + NodeID + "; \n var deleteMsg = '" + GetString("DocumentAlias.DeleteMsg") + "';");

                UniGridAlias.OnAction            += UniGridAlias_OnAction;
                UniGridAlias.OnExternalDataBound += UniGridAlias_OnExternalDataBound;
                lnkNewAlias.HRef = URLHelper.ResolveUrl("Alias_Edit.aspx?nodeid=" + NodeID);
            }

            Literal ltl = new Literal();
            ltl.Text = GetString("doc.urls.addnewalias");
            lnkNewAlias.Controls.Add(ltl);

            ltl      = new Literal();
            ltl.Text = GetString("doc.urls.aliaslist");

            lblAlias.Text = GetString("GeneralProperties.Alias");

            chkCustomExtensions.Text = GetString("GeneralProperties.UseCustomExtensions");
            valAlias.ErrorMessage    = GetString("GeneralProperties.RequiresAlias");

            lblExtensions.Text = GetString("doc.urls.urlextensions") + ResHelper.Colon;

            pnlURLPath.GroupingText = GetString("GeneralProperties.UrlPath");
            pnlAlias.GroupingText   = GetString("GeneralProperties.DocumentAlias");

            pnlDocumentAlias.GroupingText = GetString("doc.urls.documentalias");
            pnlExtended.GroupingText      = GetString("doc.urls.extendedproperties");

            if (!isRoot)
            {
                txtAlias.Enabled = !TreePathUtils.AutomaticallyUpdateDocumentAlias(CMSContext.CurrentSiteName);
            }

            if (!RequestHelper.IsPostBack())
            {
                ReloadData();
            }

            ctrlURL.AutomaticURLPath = TreePathUtils.GetUrlPathFromNamePath(Node.DocumentNamePath, Node.NodeLevel, CMSContext.CurrentSiteName);

            // Reflect processing action
            pnlPageContent.Enabled = DocumentManager.AllowSave;
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register the scripts
        ScriptHelper.RegisterProgress(Page);

        UIContext.PropertyTab = PropertyTabEnum.URLs;

        nodeId = QueryHelper.GetInteger("nodeid", 0);

        // Set where condition - show nothing when nodeId is zero
        UniGridAlias.WhereCondition = "AliasNodeID = " + nodeId;

        if (nodeId > 0)
        {
            // Get the node
            tree = new TreeProvider(CMSContext.CurrentUser);
            node = tree.SelectSingleNode(nodeId, CMSContext.PreferredCultureCode, false);

            // Redirect to page 'New culture version' in split mode. It must be before setting EditedDocument.
            if ((node == null) && displaySplitMode)
            {
                URLHelper.Redirect("~/CMSModules/Content/CMSDesk/New/NewCultureVersion.aspx" + URLHelper.Url.Query);
            }
            // Set edited document
            EditedDocument = node;

            if (node != null)
            {
                // Set IsRoot flag
                isRoot = (node.NodeClassName.ToLower() == "cms.root");

                imgSave.DisabledImageUrl     = GetImageUrl("CMSModules/CMS_Content/EditMenu/savedisabled.png");
                imgSave.ImageUrl             = GetImageUrl("CMSModules/CMS_Content/EditMenu/save.png");
                imgNewAlias.ImageUrl         = GetImageUrl("CMSModules/CMS_Content/Properties/adddocumentalias.png");
                imgNewAlias.DisabledImageUrl = GetImageUrl("CMSModules/CMS_Content/Properties/adddocumentaliasdisabled.png");
                if (node.NodeAliasPath == "/")
                {
                    valAlias.Visible = false;
                }

                // Check read permissions
                if (CMSContext.CurrentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Read) == AuthorizationResultEnum.Denied)
                {
                    RedirectToAccessDenied(String.Format(GetString("cmsdesk.notauthorizedtoreaddocument"), node.NodeAliasPath));
                }
                // Check modify permissions
                else if (CMSContext.CurrentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)
                {
                    UniGridAlias.GridView.Enabled = false;
                    lnkNewAlias.Enabled           = false;
                    imgNewAlias.Enabled           = false;

                    chkCustomExtensions.Enabled = false;
                    ctrlURL.Enabled             = false;

                    lblInfo.Visible = true;
                    lblInfo.Text    = String.Format(GetString("cmsdesk.notauthorizedtoeditdocument"), node.NodeAliasPath);

                    // Disable save button
                    lnkSave.Enabled  = false;
                    lnkSave.CssClass = "MenuItemEditDisabled";
                }
                else
                {
                    lblInfo.Visible = false;
                    ltlScript.Text  = ScriptHelper.GetScript("var node = " + nodeId + "; \n var deleteMsg = '" + GetString("DocumentAlias.DeleteMsg") + "';");

                    UniGridAlias.OnAction            += UniGridAlias_OnAction;
                    UniGridAlias.OnExternalDataBound += UniGridAlias_OnExternalDataBound;

                    // Register Save Document script
                    ScriptHelper.RegisterSaveShortcut(lnkSave, null, false);
                }

                lnkNewAlias.Text        = GetString("doc.urls.addnewalias");
                lnkNewAlias.NavigateUrl = "Alias_Edit.aspx?nodeid=" + nodeId;


                mSave         = GetString("general.save");
                lblAlias.Text = GetString("GeneralProperties.Alias");

                chkCustomExtensions.Text = GetString("GeneralProperties.UseCustomExtensions");
                valAlias.ErrorMessage    = GetString("GeneralProperties.RequiresAlias");

                lblExtensions.Text = GetString("doc.urls.urlextensions") + ResHelper.Colon;

                pnlURLPath.GroupingText = GetString("GeneralProperties.UrlPath");
                pnlAlias.GroupingText   = GetString("GeneralProperties.DocumentAlias");

                pnlDocumentAlias.GroupingText = GetString("doc.urls.documentalias");
                pnlExtended.GroupingText      = GetString("doc.urls.extendedproperties");

                if (!isRoot)
                {
                    txtAlias.Enabled = !TreePathUtils.AutomaticallyUpdateDocumentAlias(CMSContext.CurrentSiteName);
                }

                if (!RequestHelper.IsPostBack())
                {
                    ReloadData();
                }

                ctrlURL.AutomaticURLPath = TreePathUtils.GetUrlPathFromNamePath(node.DocumentNamePath, node.NodeLevel, CMSContext.CurrentSiteName);
            }

            // Register js synchronization script for split mode
            if (displaySplitMode)
            {
                RegisterSplitModeSync(true, false);
            }
        }
    }