/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnInit(EventArgs e) { base.OnInit(e); RockPage.AddCSSLink(ResolveRockUrl("~/Styles/fluidbox.css")); RockPage.AddScriptLink(ResolveRockUrl("~/Scripts/imagesloaded.min.js")); RockPage.AddScriptLink(ResolveRockUrl("~/Scripts/jquery.fluidbox.min.js")); if (Person != null) { // Record Type - this is always "business". it will never change. if (Person.RecordTypeValueId == DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.PERSON_RECORD_TYPE_BUSINESS.AsGuid()).Id) { var parms = new Dictionary <string, string>(); parms.Add("businessId", Person.Id.ToString()); NavigateToLinkedPage("BusinessDetailPage", parms); } if (Person.IsDeceased) { divBio.AddCssClass("deceased"); } // Set the browser page title to include person's name RockPage.BrowserTitle = Person.FullName; string badgeList = GetAttributeValue("Badges"); if (!string.IsNullOrWhiteSpace(badgeList)) { foreach (string badgeGuid in badgeList.SplitDelimitedValues()) { Guid guid = badgeGuid.AsGuid(); if (guid != Guid.Empty) { var personBadge = PersonBadgeCache.Read(guid); if (personBadge != null) { blStatus.PersonBadges.Add(personBadge); } } } } lbEditPerson.Visible = IsUserAuthorized(Rock.Security.Authorization.EDIT); } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnInit(EventArgs e) { base.OnInit(e); if (!Page.IsPostBack && Person != null && Person.Id != 0) { string badgeList = GetAttributeValue("Badges"); if (!string.IsNullOrWhiteSpace(badgeList)) { foreach (string badgeGuid in badgeList.SplitDelimitedValues()) { Guid guid = badgeGuid.AsGuid(); if (guid != Guid.Empty) { var personBadge = PersonBadgeCache.Read(guid); if (personBadge != null) { blBadges.PersonBadges.Add(personBadge); } } } } } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnInit(EventArgs e) { base.OnInit(e); RockPage.AddCSSLink(ResolveRockUrl("~/Styles/fluidbox.css")); RockPage.AddScriptLink(ResolveRockUrl("~/Scripts/imagesloaded.min.js")); RockPage.AddScriptLink(ResolveRockUrl("~/Scripts/jquery.fluidbox.min.js")); // this event gets fired after block settings are updated. it's nice to repaint the screen if these settings would alter it this.BlockUpdated += Block_BlockUpdated; this.AddConfigurationUpdateTrigger(pnlContent); if (Person != null) { pnlFollow.Visible = GetAttributeValue("AllowFollowing").AsBoolean(); // Record Type - this is always "business". it will never change. if (Person.RecordTypeValueId == DefinedValueCache.Read(Rock.SystemGuid.DefinedValue.PERSON_RECORD_TYPE_BUSINESS.AsGuid()).Id) { var parms = new Dictionary <string, string>(); parms.Add("businessId", Person.Id.ToString()); NavigateToLinkedPage("BusinessDetailPage", parms); } if (Person.IsDeceased) { divBio.AddCssClass("deceased"); } // Set the browser page title to include person's name RockPage.BrowserTitle = Person.FullName; string badgeList = GetAttributeValue("Badges"); if (!string.IsNullOrWhiteSpace(badgeList)) { foreach (string badgeGuid in badgeList.SplitDelimitedValues()) { Guid guid = badgeGuid.AsGuid(); if (guid != Guid.Empty) { var personBadge = PersonBadgeCache.Read(guid); if (personBadge != null) { blStatus.PersonBadges.Add(personBadge); } } } } lbEditPerson.Visible = IsUserAuthorized(Rock.Security.Authorization.EDIT); // only show if the Impersonation button if the feature is enabled, and the current user is authorized to Administrate the person bool enableImpersonation = this.GetAttributeValue("EnableImpersonation").AsBoolean(); lbImpersonate.Visible = false; if (enableImpersonation) { if (Person.IsAuthorized(Rock.Security.Authorization.ADMINISTRATE, this.CurrentPerson)) { lbImpersonate.Visible = true; } } } }