private void DocumentManager_OnAfterAction(object sender, DocumentManagerEventArgs e) { // Ensure default combination if page template changed if (PortalContext.MVTVariantsEnabled) { int templateId = Node.GetUsedPageTemplateId(); ModuleCommands.OnlineMarketingEnsureDefaultCombination(templateId); } ReloadControls(); }
private void DocumentManager_OnAfterAction(object sender, DocumentManagerEventArgs e) { // Ensure default combination if page template changed if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSMVTEnabled") && LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.MVTesting) && (ModuleCommands.OnlineMarketingContainsMVTest(Node.NodeAliasPath, Node.NodeSiteID, Node.DocumentCulture, false))) { int templateId = Node.GetUsedPageTemplateId(); ModuleCommands.OnlineMarketingEnsureDefaultCombination(templateId); } ReloadControls(); }
protected void lnkSave_Click(object sender, EventArgs e) { if (node != null) { // Check modify permissions if (currentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied) { DisableFormEditing(); lblInfo.Visible = true; lblInfo.Text = String.Format(GetString("cmsdesk.notauthorizedtoeditdocument"), node.NodeAliasPath); return; } if (hasDesign) { // Update the data int selectedPageTemplateId = ValidationHelper.GetInteger(Request.Params["SelectedTemplateId"], 0); // Save just created ad-hoc template if (cloneId > 0) { selectedPageTemplateId = cloneId; } if (selectedPageTemplateId != 0) { ltlScript.Text += ScriptHelper.GetScript("document.getElementById('SelectedTemplateId').value = " + selectedPageTemplateId); if ((txtTemplate.Text.Length > 5) && (txtTemplate.Text.ToLower().Substring(0, 6) == "ad-hoc")) { // Ad-hoc page is used, set ad-hoc page as DocumentPageTemplateID node.SetValue("DocumentPageTemplateID", selectedPageTemplateId); PageTemplateInfo pt = PageTemplateInfoProvider.GetPageTemplateInfo(selectedPageTemplateId); if (pt != null) { ltlScript.Text += ScriptHelper.GetScript("pressedClone(" + selectedPageTemplateId + ",null); ShowButtons(" + pt.IsPortal.ToString().ToLower() + ", " + pt.IsReusable.ToString().ToLower() + ", true)"); } } else { // Template was selected, set SelectedTemplateId as DocumentPageTemplateID PageTemplateInfo pt = PageTemplateInfoProvider.GetPageTemplateInfo(selectedPageTemplateId); if (pt != null) { node.SetValue("DocumentPageTemplateID", ValidationHelper.GetInteger(Request.Params["SelectedTemplateId"], 0)); ltlScript.Text += ScriptHelper.GetScript("SelectTemplate(" + selectedPageTemplateId + ", null, " + pt.IsPortal.ToString().ToLower() + ", " + pt.IsReusable.ToString().ToLower() + ")"); } } } else { // Template is inherited, set null as DocumentPageTemplateID node.SetValue("DocumentPageTemplateID", null); int inheritedTemplateID = ValidationHelper.GetInteger(Request.Params["InheritedTemplateId"], 0); if (inheritedTemplateID > 0) { PageTemplateInfo pt = PageTemplateInfoProvider.GetPageTemplateInfo(inheritedTemplateID); if (pt != null) { ltlScript.Text += ScriptHelper.GetScript("pressedInherit(" + inheritedTemplateID + "); ShowButtons(" + pt.IsPortal.ToString().ToLower() + ", " + pt.IsReusable.ToString().ToLower() + ", false)"); } } else { node.SetValue("DocumentPageTemplateID", null); ltlScript.Text += ScriptHelper.GetScript("pressedInherit(0); ShowButtons(false, false, false); "); } } } node.SetValue("NodeInheritPageLevels", inheritElem.Value); node.Update(); // Ensure default combination if page template changed if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSMVTEnabled") && LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.MVTesting) && (ModuleCommands.OnlineMarketingContainsMVTest(node.NodeAliasPath, node.NodeSiteID, node.DocumentCulture, false))) { ModuleCommands.OnlineMarketingEnsureDefaultCombination(node.DocumentPageTemplateID); } // Update search index for node if (node.PublishedVersionExists && SearchIndexInfoProvider.SearchEnabled) { SearchTaskInfoProvider.CreateTask(SearchTaskTypeEnum.Update, PredefinedObjectType.DOCUMENT, SearchHelper.ID_FIELD, node.GetSearchID()); } lblInfo.Visible = true; lblInfo.Text = GetString("General.ChangesSaved"); } // Log the synchronization DocumentSynchronizationHelper.LogDocumentChange(node, TaskTypeEnum.UpdateDocument, tree); }