/// <summary> /// Raises the <see cref="E:Init"/> event. /// </summary> protected override void OnInit(EventArgs e) { base.OnInit(e); if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.mvtest", "Read")) { RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing")); } variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty)); // Check permissions and redirect OnlineMarketingContext.CheckPermissions(variantType); // Get the alias path of the current node if (Node == null) { listElem.StopProcessing = true; } // Set NodeID in order to check the access to the document listElem.NodeID = NodeID; // Setup the list control properties pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0); zoneId = listElem.ZoneID = QueryHelper.GetString("zoneid", string.Empty); instanceGuid = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty); aliasPath = QueryHelper.GetString("aliaspath", string.Empty); webPartId = QueryHelper.GetString("webpartid", string.Empty); btnClose.Text = GetString("general.close"); }
/// <summary> /// Raises the <see cref="E:Init"/> event. /// </summary> protected override void OnInit(EventArgs e) { if (!CMSContext.CurrentUser.IsAuthorizedPerResource("cms.contentpersonalization", "Read")) { RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "Content personalization")); } // Set the ParentObject manually tor inherited templates if (editElem.UIFormControl.ParentObject == null) { string aliasPath = QueryHelper.GetString("aliaspath", string.Empty); // Get page info for the given document PageInfo pi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, aliasPath, CMSContext.PreferredCultureCode, null, CMSContext.CurrentSite.CombineWithDefaultCulture); if (pi != null) { editElem.UIFormControl.ParentObject = pi.PageTemplateInfo; } } // Get information whether the control is used for a web part or zone variant variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty)); base.OnInit(e); // Check permissions and redirect OnlineMarketingContext.CheckPermissions(variantType); // Get the alias path of the current node if (Node == null) { editElem.StopProcessing = true; } editElem.UIFormControl.OnBeforeSave += new EventHandler(UIFormControl_OnBeforeSaved); }
/// <summary> /// Raises the <see cref="E:Init"/> event. /// </summary> protected override void OnInit(EventArgs e) { base.OnInit(e); if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.contentpersonalization", "Read")) { RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "Content personalization")); } variantType = listElem.VariantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty)); // Check permissions and redirect OnlineMarketingContext.CheckPermissions(variantType); // Get the alias path of the current node if (Node == null) { listElem.StopProcessing = true; } // Setup the list control properties pageTemplateId = listElem.PageTemplateID = QueryHelper.GetInteger("templateid", 0); zoneId = listElem.ZoneID = QueryHelper.GetText("zoneid", string.Empty); instanceGuid = listElem.InstanceGUID = QueryHelper.GetGuid("instanceguid", Guid.Empty); aliasPath = QueryHelper.GetString("aliaspath", string.Empty); webPartId = QueryHelper.GetString("webpartid", string.Empty); }
/// <summary> /// Raises the <see cref="E:Init"/> event. /// </summary> protected override void OnInit(EventArgs e) { if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.mvtest", "Read")) { RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing")); } // Register the Save and close button as the form submit button HeaderActions.Visible = false; editElem.UIFormControl.SubmitButton.Visible = false; btnOk.Click += (s, ea) => editElem.UIFormControl.SaveData(null); // Turn off update document for this page EnsureDocumentManager = false; // Set the ParentObject manually tor inherited templates if (editElem.UIFormControl.ParentObject == null) { string aliasPath = QueryHelper.GetString("aliaspath", string.Empty); // Get page info for the given document PageInfo pi = PageInfoProvider.GetPageInfo(SiteContext.CurrentSiteName, aliasPath, LocalizationContext.PreferredCultureCode, null, SiteContext.CurrentSite.CombineWithDefaultCulture); if (pi != null) { editElem.UIFormControl.ParentObject = pi.UsedPageTemplateInfo; } } // Get information whether the control is used for a web part or zone variant variantType = VariantTypeFunctions.GetVariantTypeEnum(QueryHelper.GetString("varianttype", string.Empty)); mTemplateID = QueryHelper.GetInteger("templateid", 0); base.OnInit(e); // Check permissions and redirect OnlineMarketingContext.CheckPermissions(variantType); // Get the alias path of the current node if (Node == null) { editElem.StopProcessing = true; } editElem.UIFormControl.OnBeforeSave += UIFormControl_OnBeforeSaved; }