/// <summary> /// Creates an object that represents information required by this page to display Twitter insights, and returns it. /// </summary> /// <param name="accountId">The Twitter account identifier.</param> /// <returns>An object that represents information required by this page to display Twitter insights.</returns> private PageContext GetPageContextForTwitter(int accountId) { TwitterAccountInfo account = TwitterAccountInfoProvider.GetTwitterAccountInfo(accountId); if (account == null || account.TwitterAccountSiteID != SiteContext.CurrentSiteID) { throw new Exception("[CMSModules_SocialMarketing_Pages_InsightsMenu.GetPageContextForTwitter]: Twitter account with the specified identifier does not exist."); } if (!account.CheckPermissions(PermissionsEnum.Read, SiteContext.CurrentSiteName, MembershipContext.AuthenticatedUser)) { RedirectToAccessDenied(ModuleName.SOCIALMARKETING, PermissionsEnum.Read.ToString()); } return(new PageContext { ExternalId = account.TwitterAccountUserID, ReportNamePrefix = "Twitter.channel_", ReportNameFormat = "Twitter.{0}.{1}.{2}report", DisplayNameResourceNameFormat = "sm.ins.twitter.{0}" }); }