protected void Page_Load(object sender, EventArgs e) { mNewsletter = EditedObject as NewsletterInfo; if (mNewsletter == null) { RedirectToAccessDenied(GetString("general.invalidparameters")); } if (!mNewsletter.CheckPermissions(PermissionsEnum.Read, CurrentSiteName, CurrentUser)) { RedirectToAccessDenied(mNewsletter.TypeInfo.ModuleName, "Read"); } mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(CurrentSiteName); mOnlineMarketingEnabled = NewsletterHelper.OnlineMarketingAvailable(CurrentSiteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); mABTestEnabled = NewsletterHelper.IsABTestingAvailable(); ScriptHelper.RegisterDialogScript(this); string scriptBlock = string.Format(@" function RefreshPage() {{ document.location.replace(document.location); }} function NewItem(id) {{ modalDialog('{0}?parentobjectid=' + id, 'NewsletterNewIssue', screen.availWidth - 10, screen.availHeight - 80); }} function ShowOpenedBy(id) {{ modalDialog('{1}?objectid=' + id, 'NewsletterIssueOpenedBy', '900px', '700px'); return false; }} function ViewClickedLinks(id) {{ modalDialog('{2}?objectid=' + id, 'NewsletterTrackedLinks', '900px', '700px'); return false; }}", ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_New.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_OpenedBy.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_TrackedLinks.aspx")); ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Actions", scriptBlock, true); // Initialize unigrid UniGrid.WhereCondition = String.Format("IssueNewsletterID={0} AND IssueVariantOfIssueID IS NULL", mNewsletter.NewsletterID); UniGrid.ZeroRowsText = GetString("Newsletter_Issue_List.NoIssuesFound"); UniGrid.OnAction += uniGrid_OnAction; UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload; UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound; // Initialize header actions InitHeaderActions(); }
protected void Page_Load(object sender, EventArgs e) { newsletterId = QueryHelper.GetInteger("newsletterid", 0); if (newsletterId == 0) { RequestHelper.EndResponse(); } // Get newsletter object and check its existence mNewsletter = NewsletterInfoProvider.GetNewsletterInfo(newsletterId); EditedObject = mNewsletter; string siteName = CMSContext.CurrentSiteName; mBounceMonitoringEnabled = NewsletterHelper.MonitorBouncedEmails(siteName); mOnlineMarketingEnabled = NewsletterHelper.OnlineMarketingAvailable(siteName); mTrackingEnabled = NewsletterHelper.IsTrackingAvailable(); mABTestEnabled = NewsletterHelper.IsABTestingAvailable(); ScriptHelper.RegisterDialogScript(this); string scriptBlock = string.Format(@" function RefreshPage() {{ document.location.replace(document.location); }} function NewItem(id) {{ modalDialog('{0}?newsletterid=' + id, 'NewsletterNewIssue', screen.availWidth - 10, screen.availHeight - 80); }} function ShowOpenedBy(id) {{ modalDialog('{1}?issueid=' + id, 'NewsletterIssueOpenedBy', '900px', '700px'); return false; }} function ViewClickedLinks(id) {{ modalDialog('{2}?issueid=' + id, 'NewsletterTrackedLinks', '900px', '700px'); return false; }}", ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_New.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_OpenedBy.aspx"), ResolveUrl(@"~\CMSModules\Newsletters\Tools\Newsletters\Newsletter_Issue_TrackedLinks.aspx")); ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Actions", scriptBlock, true); // Initialize unigrid UniGrid.WhereCondition = String.Format("IssueNewsletterID={0} AND IssueVariantOfIssueID IS NULL", newsletterId); UniGrid.ZeroRowsText = GetString("Newsletter_Issue_List.NoIssuesFound"); UniGrid.OnAction += uniGrid_OnAction; UniGrid.OnBeforeDataReload += UniGrid_OnBeforeDataReload; UniGrid.OnExternalDataBound += UniGrid_OnExternalDataBound; // Initialize header actions InitHeaderActions(); }