protected void Page_Load(object sender, EventArgs e) { ((CMSMasterPage)CurrentMaster).PanelBody.CssClass += " Separator"; // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Configuration", null, "menu"); }
protected void Page_Load(object sender, EventArgs e) { // In cmsdesk siteID is in control if (!this.IsSiteManager) { // Init site filter when user is authorised for global and site contacts if (AuthorizedForGlobalContacts && AuthorizedForSiteContacts) { CurrentMaster.DisplaySiteSelectorPanel = true; if (!RequestHelper.IsPostBack()) { SiteOrGlobalSelector.SiteID = QueryHelper.GetInteger("siteId", CMSContext.CurrentSiteID); } listElem.SiteID = SiteOrGlobalSelector.SiteID; if (listElem.SiteID == UniSelector.US_GLOBAL_OR_SITE_RECORD) { listElem.WhereCondition = SiteOrGlobalSelector.GetSiteWhereCondition("ContactSiteID"); } } // Authorised for site contacts only else if (AuthorizedForSiteContacts) { listElem.SiteID = CMSContext.CurrentSiteID; } // Authorised for global contacts only else if (AuthorizedForGlobalContacts) { listElem.SiteID = UniSelector.US_GLOBAL_RECORD; } // User is not authorized else { RedirectToCMSDeskAccessDenied("CMS.ContactManagement", "ReadContacts"); } } // In sitemanager "siteID" is in querystring else { listElem.SiteID = this.SiteID; // Hide title CurrentMaster.Title.TitleText = CurrentMaster.Title.TitleImage = string.Empty; } // Set header actions (add button) string url = this.ResolveUrl("New.aspx?siteId=" + listElem.SiteID); if (this.IsSiteManager) { url = URLHelper.AddParameterToUrl(url, "isSiteManager", "1"); } string[,] actions = new string[1, 8]; actions[0, 0] = "HyperLink"; actions[0, 1] = GetString("om.contact.new"); actions[0, 3] = url; actions[0, 5] = GetImageUrl("Objects/OM_Contact/add.png"); hdrActions.Actions = actions; // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Contacts", null, "menu"); }
protected void Page_Load(object sender, EventArgs e) { // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Activities", null, "menu"); // If in Site Manager... if (ContactHelper.IsSiteManager) { // Set Breadcrumbs InitBreadcrumbs(1); SetBreadcrumb(0, GetString("om.activity.list"), null, null, null); // Hide title CurrentMaster.Title.TitleText = CurrentMaster.Title.TitleImage = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { this.CurrentMaster.Title.TitleText = GetString("Newsletters.HeaderCaption"); this.CurrentMaster.Title.TitleImage = GetImageUrl("Objects/Newsletter_Newsletter/object.png"); this.CurrentMaster.Title.HelpName = "helpTopic"; this.CurrentMaster.Title.HelpTopicName = "CMS_Newsletter_Newsletters"; // Load action page directly, if set by URL switch (QueryHelper.GetString("action", null)) { case "newnewsletter": this.CurrentMaster.Tabs.StartPageURL = URLHelper.ResolveUrl("Newsletters/Newsletter_New.aspx"); break; } // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Newsletters", null, "menu"); }
protected void Page_Load(object sender, EventArgs e) { var cu = MembershipContext.AuthenticatedUser; // Check permissions if ((cu == null) || !cu.IsAuthorizedPerResource("CMS.OnlineMarketing", "Read")) { CMSPage.RedirectToAccessDenied("CMS.OnlineMarketing", "Read"); } // Check UIProfile if (!cu.IsAuthorizedPerUIElement("CMS.OnlineMarketing", "OMDashBoard")) { CMSPage.RedirectToUIElementAccessDenied("CMS.OnlineMarketing", "OMDashBoard"); } // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "OMDashBoard", null, "menu"); }
protected void Page_PreInit(object sender, EventArgs e) { siteId = QueryHelper.GetInteger("siteid", CMSContext.CurrentSiteID); string url = ResolveUrl("~/CMSModules/ContactManagement/Pages/Tools/Contact/List.aspx"); url = URLHelper.AddParameterToUrl(url, "siteid", siteId.ToString()); if (this.IsSiteManager) { url = URLHelper.AddParameterToUrl(url, "issitemanager", "1"); } CurrentPage.InitBreadcrumbs(2); CurrentPage.SetBreadcrumb(0, GetString("om.contact.list"), url, null, null); CurrentPage.SetBreadcrumb(1, GetString("om.contact.new"), null, null, null); editElem.SiteID = siteId; // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "NewContact", null, "menu"); }
/// <summary> /// Raises the callback event. /// </summary> public void RaiseCallbackEvent(string eventArgument) { if ((eventArgument == null)) { return; } string[] argumentParts = eventArgument.Split(';'); if (argumentParts.Length > 0) { string action = argumentParts[0]; switch (action) { // Get edit page url (also consider custom document type urls) case "editurl": { int nodeId = ValidationHelper.GetInteger(argumentParts[1], 0); // Prepare url retriever settings UIPageURLSettings settings = new UIPageURLSettings(); settings.AllowSplitview = false; settings.NodeID = nodeId; settings.AdditionalQuery = "dialog=1"; settings.Mode = "editform"; settings.Action = null; settings.Culture = preferredCultureCode; // Get edit page url callbackResult = CMSDeskPage.GetUIPageURL(settings); } break; default: break; } } }
protected void gridPosts_OnAction(string actionName, object actionArgument) { int postId = ValidationHelper.GetInteger(actionArgument, 0); if (actionName.ToLowerCSafe() == "delete") { if (CommunityGroupID == 0) { // Check forums modify permissions if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.forums", PERMISSION_MODIFY)) { RedirectToAccessDenied("cms.forums", PERMISSION_MODIFY); } } else { // Check group permissions CMSDeskPage.CheckGroupPermissions(CommunityGroupID, PERMISSION_MANAGE); } ForumPostInfoProvider.DeleteForumPostInfo(postId); } }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void uniGrid_OnAction(string actionName, object actionArgument) { if (actionName == "edit") { SelectedItemID = Convert.ToInt32(actionArgument); RaiseOnEdit(); } else if (actionName == "delete") { if (!AllowEdit) { return; } if (GroupId > 0) { CMSDeskPage.CheckGroupPermissions(GroupId, PERMISSION_MANAGE); } // Delete PollAnswerInfo object from database PollAnswerInfoProvider.DeletePollAnswerInfo(Convert.ToInt32(actionArgument)); ReloadData(true); } }
protected void btnOk_Click(object sender, EventArgs e) { if (CommunityGroupID == 0) { // Check forums modify permissions if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("cms.forums", PERMISSION_MODIFY)) { RedirectToAccessDenied("cms.forums", PERMISSION_MODIFY); } } else { // Check group permissions CMSDeskPage.CheckGroupPermissions(CommunityGroupID, PERMISSION_MANAGE); } Action action = (Action)ValidationHelper.GetInteger(drpAction.SelectedValue, 0); What what = What.Selected; //(What)ValidationHelper.GetInteger(drpWhat.SelectedValue, 0); List <int> items = new List <int>(); switch (what) { // Only selected posts case What.Selected: foreach (string item in gridPosts.SelectedItems) { items.Add(ValidationHelper.GetInteger(item, 0)); } break; // On posts in unigrid case What.All: DataSet ds = gridPosts.GridView.DataSource as DataSet; if (!DataHelper.DataSourceIsEmpty(ds)) { foreach (DataRow dr in ds.Tables[0].Rows) { int postId = ValidationHelper.GetInteger(dr["PostId"], 0); items.Add(postId); } } break; } // For all specified forum posts foreach (int postId in items) { ForumPostInfo fpi = ForumPostInfoProvider.GetForumPostInfo(postId); if (fpi != null) { switch (action) { // Approve post case Action.Approve: fpi.Approve(); break; // Approve subtree case Action.ApproveSubTree: fpi.Approve(MembershipContext.AuthenticatedUser.UserID, true); break; // Reject post case Action.Reject: fpi.Reject(); break; // Reject subtree case Action.RejectSubTree: fpi.Reject(true); break; // Delete post case Action.Delete: ForumPostInfoProvider.DeleteForumPostInfo(fpi); break; } } } // If something happened if (items.Count > 0) { // Get rid of selection gridPosts.ResetSelection(); // Reload unigrid to see changes gridPosts.ReloadData(); // Force refresh post tree ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "RefreshPostTree", ScriptHelper.GetScript("SelectInTree(" + PostId + ", true);")); } }
private bool CheckGroupPermissions() { return(GroupID > 0 && CMSDeskPage.CheckGroupPermissions(GroupID, PERMISSION_MANAGE, false)); }
/// <summary> /// Registers script files for on-site editing /// </summary> /// <param name="pi">Current page info</param> private void RegisterEditScripts(PageInfo pi) { ScriptHelper.RegisterJQueryCookie(Page); StringBuilder script = new StringBuilder(); // Edit toolbar scripts if (ViewMode == ViewModeEnum.EditLive) { // Dialog scripts ScriptHelper.RegisterDialogScript(Page); // General url settings UIPageURLSettings settings = new UIPageURLSettings(); settings.AllowSplitview = false; settings.NodeID = pi.NodeID; settings.Culture = pi.DocumentCulture; settings.AdditionalQuery = "dialog=1"; // Edit document settings.Mode = "editform"; settings.Action = null; string editUrl = CMSDeskPage.GetUIPageURL(settings); settings.Mode = string.Empty; // Toolbar - Edit button script editUrl = URLHelper.RemoveParameterFromUrl(editUrl, "mode"); string scriptEdit = GetModalDialogScript(editUrl, "editpage"); // User contributions - Edit item script string scriptEditItem = GetModalDialogScript(AddItemUrlParameters(editUrl), "editpage"); // Delete document settings.Action = "delete"; string deleteUrl = CMSDeskPage.GetUIPageURL(settings); // Toolbar - Delete button script string scriptDelete = GetModalDialogScript(deleteUrl, "deletepage"); // User contributions - Delete item script string scriptDeleteItem = GetModalDialogScript(AddItemUrlParameters(deleteUrl), "deletepage"); // New document settings.Action = "new"; settings.AdditionalQuery += "&reloadnewpage=1"; string newUrl = CMSDeskPage.GetUIPageURL(settings); newUrl = AddNewItemUrlParameters(newUrl); // Toolbar - New button script string scriptNew = GetModalDialogScript(newUrl, "newpage"); // Toolbar - Properties button script string scriptProperties = GetModalDialogScript(ResolveUrl("~/CMSModules/Content/CMSDesk/Properties/Properties_Frameset.aspx?mode=editlive&documentid=" + pi.DocumentID), "propertiespage"); // Display items from current level by default int nodeId = pi.NodeParentID; // If current level is root display first level if (nodeId == 0) { isRootDocument = true; nodeId = pi.NodeID; } // In page not found mode display first level if (nodeId == 0) { TreeProvider tp = new TreeProvider(cui); TreeNode tn = tp.SelectSingleNode(CMSContext.CurrentSiteName, "/", TreeProvider.ALL_CULTURES); if (tn != null) { nodeId = tn.NodeID; } } // Listing string listItemUrl = ResolveUrl("~/CMSModules/Content/CMSDesk/View/listing.aspx?dialog=1&wopenernodeid=" + pi.NodeID + "&nodeid=##id##"); string scriptListItem = GetModalDialogScript(listItemUrl.Replace("##id##", nodeId.ToString()), "listingpage"); // New culture string newCultureUrl = ResolveUrl("~/CMSModules/Content/CMSDesk/New/NewCultureVersion.aspx?nodeid=##id##&culture=##cult##&dialog=1"); script.Append(@" var OEEditImagePath = '", GetImageUrl("CMSModules/CMS_PortalEngine/OnSiteEdit/webpart_edit.png"), @"'; var OEConfigureImagePath = '", GetImageUrl("CMSModules/CMS_PortalEngine/OnSiteEdit/webpart_properties.png"), @"'; var OEIsRTL = ", (isRTL ? "true" : "false"), @"; var OECurrentNodeId = ", (CMSContext.CurrentPageInfo != null) ? CMSContext.CurrentPageInfo.NodeID : 0, @"; var OEIsMobile = ", (CMSContext.CurrentDevice.IsMobile ? "true" : "false"), @"; var OEHdnPostbackValue = null; function ConfigureWebPart(webPartZoneId, webPartId, aliasPath, instanceGuid, templateId, refreshOnCancel) { modalDialog('", OnSiteEditHelper.WebPartPropertiesPageUrl, @"?aliaspath=' + aliasPath + '&zoneid=' + webPartZoneId + '&webpartid=' + webPartId + '&culture=' + ", preferredCultureCode, @" + '&instanceguid=' + instanceGuid + '&templateid=' + templateId + (!!refreshOnCancel ? '&refreshoncancel=true' : ''), 'configurewebpart', 900, 638); } function NewDocument(parentId, classId, targetWindow) { OEClearZIndex(OEActiveWebPart); if (targetWindow == null) { ", scriptNew, @"; } else { targetWindow.location.href = '", newUrl, @"'; } } function EditDocument(nodeId, targetWindow) { OEClearZIndex(OEActiveWebPart); // Edit item button in repeaters and datalists var arg = 'editurl;' + nodeId; ", Page.ClientScript.GetCallbackEventReference(this, "arg", "OECallbackHandler", null), @"; } function OECallbackHandler(arg, context) { ", GetModalDialogScript("arg", "editpage", false), @" } function DeleteDocument(nodeId) { OEClearZIndex(OEActiveWebPart); ", scriptDeleteItem, @" } function OnSiteToolbarAction(name) { switch(name) { case 'edit': ", scriptEdit, @" break; case 'properties': ", scriptProperties, @" break; case 'new': var parentId = OECurrentNodeId; var classId = 0; ", scriptNew, @" break; case 'delete': ", scriptDelete, @" break; case 'list': ", scriptListItem, @" break; default: alert('Required action is not implemented.'); } } function SelectNode(nodeId, parentNodeId) { var liu = '", listItemUrl, @"'; return liu.replace(/##id##/g, nodeId); } function NewDocumentCulture(nodeId, culture) { var liu = '", newCultureUrl, @"'; liu = liu.replace(/##id##/g, nodeId); liu = liu.replace(/##cult##/g, culture); ", GetModalDialogScript("liu", "newculture", false), @" } function ToggleUpdateProgress(show) { var loadingBg = jQuery('.OnSiteUPBg'); var loading = jQuery('#", updateProgress.ClientID, @"'); if (show) { loading.css('display', 'inline'); loadingBg.show(); } else { loading.hide(); loadingBg.hide(); } } function OEEnsureHdnPostbackValue() { if (OEHdnPostbackValue == null) { OEHdnPostbackValue = document.getElementById('", hdnPostbackValue.ClientID, @"'); } } // Changes the device profile function ChangeDevice(device) { OEEnsureHdnPostbackValue(); OEHdnPostbackValue.value = device; ", ControlsHelper.GetPostBackEventReference(this, "changedeviceprofile"), @" } "); // Register jQuery ScriptHelper.RegisterJQueryDialog(Page); // Register OnSiteEdit script file ScriptHelper.RegisterScriptFile(Page, "DesignMode/OnSiteEdit.js"); ScriptHelper.RegisterScriptFile(Page, "~/CMSScripts/jquery/jquery-url.js"); } // Slider buttons scripts else if (ViewMode == ViewModeEnum.LiveSite) { bool sliderIsMinimized = ValidationHelper.GetBoolean(CookieHelper.GetValue(CookieName.OnSiteButtonMinimized), false); if (sliderIsMinimized) { // Renew the cookie CookieHelper.SetValue(CookieName.OnSiteButtonMinimized, "true", "/", DateTime.Now.AddDays(31), false); } script.Append(@" var OEIsMinimized = ", (sliderIsMinimized ? "true" : "false"), @"; function OESlideSideToolbar() { // Hide the slider button in CMSDesk if (parent != this) { return; } var toolbarEl = document.getElementById('", pnlSlider.ClientID, @"'); toolbarEl.style.display = ""block""; if (!OEIsMinimized) { // Show slider button toolbarEl.style.top = ""0px""; document.getElementById('", imgMinimize.ClientID, @"').style.display = ""inline""; document.getElementById('", imgMaximize.ClientID, @"').style.display = ""none""; jQuery.cookie('", CookieName.OnSiteButtonMinimized, @"', null, { path: '/' }); } else { // Hide slider button var sliderButtonEl = document.getElementById('", pnlButton.ClientID, @"'); toolbarEl.style.top = ""-"" + (sliderButtonEl.offsetHeight + 1) + ""px""; document.getElementById('", imgMinimize.ClientID, @"').style.display = ""none""; document.getElementById('", imgMaximize.ClientID, @"').style.display = ""inline""; jQuery.cookie('", CookieName.OnSiteButtonMinimized, @"', true, { path: '/', expires: 31 }); } OEIsMinimized = !OEIsMinimized; } // Display slider button jQuery(document).ready(function() { OESlideSideToolbar(); }); "); } script.Append(" function OnSiteEdit_ChangeEditMode(){", ControlsHelper.GetPostBackEventReference(this, "changeviewmode"), "} "); ControlsHelper.RegisterClientScriptBlock(this, Page, typeof(string), "OnSiteEditActions", ScriptHelper.GetScript(script.ToString())); }
protected void Page_Load(object sender, EventArgs e) { // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Scoring", null, "menu"); CurrentMaster.HeaderActions.Actions[0, 3] += URLHelper.Url.Query; }
protected void Page_Load(object sender, EventArgs e) { // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Contacts", null, "menu"); // Get current user info CurrentUserInfo user = CMSContext.CurrentUser; // Get contact info object ContactInfo ci = (ContactInfo)EditedObject; if (ci == null) { return; } // Check permission read ContactHelper.AuthorizedReadContact(ci.ContactSiteID, true); // Check if running under site manager (and distribute "site manager" flag to other tabs) string siteManagerParam = string.Empty; if (this.IsSiteManager) { siteManagerParam = "&issitemanager=1"; // Hide title CurrentMaster.Title.TitleText = CurrentMaster.Title.TitleImage = string.Empty; } else { // Set title CurrentMaster.Title.TitleImage = GetImageUrl("Objects/OM_Contact/object.png"); CurrentMaster.Title.TitleText = GetString("om.contact.edit"); } // Set default help topic SetHelp("onlinemarketing_contact_general", "helpTopic"); string append = null; if (ci.ContactMergedWithContactID != 0) { // Append '(merged)' behind contact name in breadcrumbs append = " " + GetString("om.contact.mergedsuffix"); } else if (ci.ContactSiteID == 0) { // Append '(global)' behind contact name in breadcrumbs append = " " + GetString("om.contact.globalsuffix"); } // Modify header appearance in modal dialog (display title instead of breadcrumbs) if (QueryHelper.GetBoolean("dialogmode", false)) { CurrentMaster.Title.TitleText = GetString("om.contact.edit") + " - " + HTMLHelper.HTMLEncode(ContactInfoProvider.GetContactFullName(ci)) + append; CurrentMaster.Title.TitleImage = GetImageUrl("Objects/OM_Contact/object.png"); } else { // Get url for breadcrumbs string url = ResolveUrl("~/CMSModules/ContactManagement/Pages/Tools/Contact/List.aspx"); url = URLHelper.AddParameterToUrl(url, "siteid", this.SiteID.ToString()); if (this.IsSiteManager) { url = URLHelper.AddParameterToUrl(url, "issitemanager", "1"); } CurrentPage.InitBreadcrumbs(2); CurrentPage.SetBreadcrumb(0, GetString("om.contact.list"), url, "_parent", null); CurrentPage.SetBreadcrumb(1, ContactInfoProvider.GetContactFullName(ci) + append, null, null, null); } // Check if contact has any custom fields int i = 0; FormInfo formInfo = FormHelper.GetFormInfo(ci.Generalized.DataClass.ClassName, false); if (formInfo.GetFormElements(true, false, true).Count > 0) { i = 1; } int contactId = ci.ContactID; bool ipTabAvailable = ActivitySettingsHelper.IPLoggingEnabled(CMSContext.CurrentSiteName) || ContactHelper.IsSiteManager; int counter = 0; // Initialize tabs this.InitTabs(7 + (ipTabAvailable ? 1 : 0) + i, "content"); this.SetTab(counter++, GetString("general.general"), "Tab_General.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_general');"); if (i > 0) { // Add tab for custom fields this.SetTab(counter++, GetString("general.customfields"), "Tab_CustomFields.aspx?contactid=" + ci.ContactID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_customfields');"); } if (AccountHelper.AuthorizedReadAccount(ci.ContactSiteID, false) || ContactHelper.AuthorizedReadContact(ci.ContactSiteID, false)) { this.SetTab(counter++, GetString("om.account.list"), "Tab_Accounts.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_accounts');"); } this.SetTab(counter++, GetString("om.membership.list"), "Membership/Tab_Membership.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_membership');"); this.SetTab(counter++, GetString("om.activity.list"), "Tab_Activities.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_activities');"); if (ipTabAvailable) { this.SetTab(counter++, GetString("om.activity.iplist"), "Tab_IPs.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_ips');"); } // Show contact groups this.SetTab(counter++, GetString("om.contactgroup.list"), "Tab_ContactGroups.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_contactgroups');"); // Show scoring tab for site contacts if (ci.ContactSiteID > 0) { this.SetTab(counter++, GetString("om.score.list"), "Tab_Scoring.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_scoring');"); } // Hide last 3 tabs if the contact is merged if (ci.ContactMergedWithContactID == 0) { this.SetTab(counter++, GetString("om.contact.merge"), "Tab_Merge.aspx?contactid=" + contactId + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_contact_merge');"); } }
protected void Page_Load(object sender, EventArgs e) { if (EditedObject != null) { // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Accounts", null, "menu"); // Get account info object AccountInfo ai = (AccountInfo)EditedObject; string append = null; // Check permission AccountHelper.AuthorizedReadAccount(ai.AccountSiteID, true); // Check if running under site manager (and distribute "site manager" flag to other tabs) string siteManagerParam = string.Empty; if (this.IsSiteManager) { siteManagerParam = "&issitemanager=1"; // Hide title CurrentMaster.Title.TitleText = CurrentMaster.Title.TitleImage = string.Empty; } else { // Set title CurrentMaster.Title.TitleImage = GetImageUrl("Objects/OM_Account/object.png"); CurrentMaster.Title.TitleText = GetString("om.account.edit"); } // Set default help topic SetHelp("onlinemarketing_account_general", "helpTopic"); // Append '(merged)' behind account name in breadcrumbs if (ai.AccountMergedWithAccountID != 0) { append = " " + GetString("om.account.mergedsuffix"); } // Append '(global)' else if (ai.AccountSiteID == 0) { append = " " + GetString("om.account.globalsuffix"); } // Modify header appearance in modal dialog (display title instead of breadcrumbs) if (QueryHelper.GetBoolean("dialogmode", false)) { CurrentMaster.Title.TitleText = GetString("om.account.edit") + " - " + HTMLHelper.HTMLEncode(ai.AccountName) + append; CurrentMaster.Title.TitleImage = GetImageUrl("Objects/OM_Account/object.png"); } else { // Get url for breadcrumbs string url = ResolveUrl("~/CMSModules/ContactManagement/Pages/Tools/Account/List.aspx"); url = URLHelper.AddParameterToUrl(url, "siteid", this.SiteID.ToString()); if (this.IsSiteManager) { url = URLHelper.AddParameterToUrl(url, "issitemanager", "1"); } CurrentPage.InitBreadcrumbs(2); CurrentPage.SetBreadcrumb(0, GetString("om.account.list"), url, "_parent", null); CurrentPage.SetBreadcrumb(1, HTMLHelper.HTMLEncode(CMSContext.ResolveMacros("{%EditedObject.DisplayName%}")) + append, null, null, null); } // Check if account has any custom fields int i = 0; FormInfo formInfo = FormHelper.GetFormInfo(ai.ClassName, false); if (formInfo.GetFormElements(true, false, true).Count > 0) { i = 1; } // Initialize tabs this.InitTabs(4 + i, "content"); this.SetTab(0, GetString("general.general"), "Tab_General.aspx?accountid=" + ai.AccountID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_account_general');"); if (i > 0) { // Add tab for custom fields this.SetTab(1, GetString("general.customfields"), "Tab_CustomFields.aspx?accountid=" + ai.AccountID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_account_customfields');"); } // Display contacts tab only if user is authorized to read contacts if (ContactHelper.AuthorizedReadContact(ai.AccountSiteID, false) || AccountHelper.AuthorizedReadAccount(ai.AccountSiteID, false)) { this.SetTab(1 + i, GetString("om.contact.list"), "Tab_Contacts.aspx?accountid=" + ai.AccountID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_account_contacts');"); } // Hide last 2 tabs if the account is merged if (ai.AccountMergedWithAccountID == 0) { this.SetTab(2 + i, GetString("om.account.subsidiaries"), "Tab_Subsidiaries.aspx?accountid=" + ai.AccountID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_account_subsidiaries');"); this.SetTab(3 + i, GetString("om.account.merge"), "Tab_Merge.aspx?accountid=" + ai.AccountID + siteManagerParam, "SetHelpTopic('helpTopic', 'onlinemarketing_account_merge');"); } } }
protected void Page_Load(object sender, EventArgs e) { // Register script for unimenu button selection CMSDeskPage.AddMenuButtonSelectScript(this, "Scoring", null, "menu"); }