Beispiel #1
0
    private void DocumentManager_OnAfterAction(object sender, DocumentManagerEventArgs e)
    {
        txtAlias.Text = Node.NodeAlias;

        // Check if alias was changed
        if (Node.NodeAliasPath != mOldAliasPath)
        {
            // Update all related MVTests
            ModuleCommands.OnlineMarketingMoveMVTests(Node.NodeAliasPath, mOldAliasPath, SiteContext.CurrentSiteID);
        }

        // Load the URL path
        LoadURLPath(Node);

        UniGridAlias.ReloadData();

        if ((!pnlUIAlias.IsHidden || !pnlUIPath.IsHidden) && aliasChanged && (PortalContext.ViewMode == ViewModeEnum.EditLive))
        {
            // Get the updated document url
            string url = UrlResolver.ResolveUrl(DocumentURLProvider.GetUrl(Node));

            // Register redirect script
            string reloadScript = "if (parent.parent.frames['header'] != null) { parent.parent.frames['header'].reloadPageUrl =" + ScriptHelper.GetString(url) + "; }";
            ScriptHelper.RegisterStartupScript(this, typeof(string), "reloadScript", reloadScript, true);
        }
    }
    private void DocumentManager_OnAfterAction(object sender, DocumentManagerEventArgs e)
    {
        txtAlias.Text = Node.NodeAlias;

        // If alias was changed, update all related MVTests
        if (Node.NodeAliasPath != oldAliasPath)
        {
            ModuleCommands.OnlineMarketingMoveMVTests(Node.NodeAliasPath, oldAliasPath, SiteContext.CurrentSiteID);
        }

        // Load the URL path
        LoadURLPath(Node);

        UniGridAlias.ReloadData();
    }
Beispiel #3
0
    protected void lnkSave_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txtAlias.Text.Trim()) && !isRoot)
        {
            lblError.Visible = true;
            lblError.Text    = GetString("general.errorvalidationerror");
        }
        else
        {
            // Get the document
            if (node != null)
            {
                // Check modify permissions
                if (CMSContext.CurrentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)
                {
                    return;
                }

                // PATH group is displayed
                if (!this.pnlUIPath.IsHidden)
                {
                    node.NodeAlias = txtAlias.Text.Trim();

                    node.DocumentUseNamePathForUrlPath = !ctrlURL.IsCustom;
                    if (node.DocumentUseNamePathForUrlPath)
                    {
                        string urlPath = TreePathUtils.GetUrlPathFromNamePath(node.DocumentNamePath, node.NodeLevel, CMSContext.CurrentSiteName);
                        node.DocumentUrlPath = urlPath;
                    }
                    else
                    {
                        node.DocumentUrlPath = TreePathUtils.GetSafeUrlPath(ctrlURL.URLPath, CMSContext.CurrentSiteName, true);
                    }
                }

                // EXTENDED group is displayed
                if (!this.pnlUIExtended.IsHidden)
                {
                    node.DocumentUseCustomExtensions = chkCustomExtensions.Checked;
                    if (node.DocumentUseCustomExtensions)
                    {
                        node.DocumentExtensions = txtExtensions.Text;
                    }
                }

                // Save the data
                node.Update();

                // Update search index
                if ((node.PublishedVersionExists) && (SearchIndexInfoProvider.SearchEnabled))
                {
                    SearchTaskInfoProvider.CreateTask(SearchTaskTypeEnum.Update, PredefinedObjectType.DOCUMENT, SearchHelper.ID_FIELD, node.GetSearchID());
                }

                txtAlias.Text = node.NodeAlias;

                // Load the URL path
                LoadURLPath(node);

                // Log synchronization
                DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree);

                lblInfo.Visible = true;
                lblInfo.Text    = GetString("General.ChangesSaved");

                UniGridAlias.ReloadData();
            }
        }
    }