/// <summary> /// Initializes workflow step edit menu. /// </summary> protected void InitalizeMenu() { UITabs tabs = CurrentMaster.Tabs; if (CurrentWorkflowStep != null) { TabItem general = new TabItem() { Text = GetString("general.general"), OnClientClick = string.Format("SetHelpTopic('helpTopic', '{0}');", CurrentWorkflow.IsAutomation ? "process_step" : "workflow_step"), RedirectUrl = "Workflow_Step_General.aspx?workflowStepId=" + WorkflowStepID }; tabs.TabItems.Add(general); if (!CurrentWorkflowStep.StepIsDefault) { if (CurrentWorkflowStep.StepAllowBranch) { TabItem cases = new TabItem() { Text = GetString("development-workflow_edit.sourcepoints"), OnClientClick = string.Format("SetHelpTopic('helpTopic', '{0}');", CurrentWorkflow.IsAutomation ? "process_step_cases" : "workflow_step_cases"), RedirectUrl = "Pages/WorkflowStep/SourcePoint/List.aspx?workflowStepId=" + WorkflowStepID }; tabs.TabItems.Add(cases); } tabs.SelectedTab = SelectedTab; if (ShowSecurityTab) { TabItem security = new TabItem() { Text = GetString("general.security"), OnClientClick = string.Format("SetHelpTopic('helpTopic', '{0}');", CurrentWorkflow.IsAutomation ? "process_step_security" : "workflow_step_security"), RedirectUrl = "Workflow_Step_Security.aspx?workflowStepId=" + WorkflowStepID }; tabs.TabItems.Add(security); } if (ShowEmailsTab) { TabItem emails = new TabItem() { Text = GetString("Development-Workflow_Edit.Emails"), OnClientClick = "SetHelpTopic('helpTopic', 'workflow_step_emails');", RedirectUrl = "Workflow_Step_Emails.aspx?workflowStepId=" + WorkflowStepID }; tabs.TabItems.Add(emails); } } tabs.UrlTarget = "wfStepContent"; } }
protected void Page_PreRender(object sender, EventArgs e) { UITabs tabs = ((CMSMasterPage)CurrentMaster).Tabs; // Remove 'saved' query parameter string query = URLHelper.RemoveUrlParameter(URLHelper.Url.Query, "saved"); for (int i = 0; i < tabs.TabItems.Count; i++) { tabs.TabItems[i].RedirectUrl += query; } }
protected void Page_PreRender(object sender, EventArgs e) { UITabs tabs = ((CMSMasterPage)CurrentMaster).Tabs; for (int i = 0; i < tabs.TabItems.Count; i++) { if (!String.IsNullOrEmpty(tabs.TabItems[i].RedirectUrl)) { tabs.TabItems[i].RedirectUrl += URLHelper.Url.Query; } } }
protected void Page_PreRender(object sender, EventArgs e) { UITabs tabs = ((CMSMasterPage)CurrentMaster).Tabs; for (int i = 0; i < tabs.Tabs.GetLength(0); i++) { if (!String.IsNullOrEmpty(tabs.Tabs[i, 2])) { tabs.Tabs[i, 2] += URLHelper.Url.Query; } } }
protected void Page_PreRender(object sender, EventArgs e) { UITabs tabs = ((CMSMasterPage)CurrentMaster).Tabs; // Remove 'saved' query parameter string query = URLHelper.RemoveUrlParameter(URLHelper.Url.Query, "saved"); for (int i = 0; i < tabs.Tabs.GetLength(0); i++) { tabs.Tabs[i, 2] += query; } }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { // No actions if processing is stopped } else { SetHeaderControls(paneTitle); var isDesign = PortalContext.ViewMode.IsDesign(true); if (isDesign) { paneContent.RenderAs = HtmlTextWriterTag.Div; } // Handle title ManagePaneTitle(paneTitle, true); // Show dialog footer only when used in a dialog layoutElem.DisplayFooter = DisplayFooter; tabControl = paneTabs.FindControl("tabsElem") as UITabs; // Ensure correct property UIContext["DisplayTitleInTabs"] = GetValue("DisplayTitleInTabs"); if (tabControl != null) { tabControl.ElementName = ElementName; tabControl.ModuleName = ResourceName; tabControl.DefaultTabName = DefaultTabName; tabControl.TabControlLayout = TabControlLayoutEnum.Vertical; tabControl.RememberSelectedTab = RememberSelectedTab && !isDesign; tabControl.AllowSubTabs = AllowSubTabs; // Set selected tab based on tab index int tabIndex = ValidationHelper.GetInteger(UIContext["TabIndex"], 0); if (tabIndex != 0) { tabControl.SelectedTab = tabIndex; tabControl.SelectFirstItemByDefault = false; } tabControl.OnTabCreated += tabControl_OnTabCreated; RegisterBreadcrumbsScript(); } } }
protected void Page_PreRender(object sender, EventArgs e) { // Join URL queries if needed string query = URLHelper.Url.Query; if (!String.IsNullOrEmpty(query)) { UITabs tabs = ((CMSMasterPage)CurrentMaster).Tabs; foreach (TabItem t in tabs.TabItems) { if (!String.IsNullOrEmpty(t.RedirectUrl)) { t.RedirectUrl = URLHelper.AppendQuery(t.RedirectUrl, query); } } } }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { // No actions if processing is stopped } else { ManagePaneTitle(paneTabs, false); // Show dialog footer only when used in a dialog layoutElem.DisplayFooter = DisplayFooter; if (IsDialog) { paneTabs.PaneClass = "DialogsPageHeader"; } tabControl = paneTabs.FindControl("tabsElem") as UITabs; if (tabControl != null) { tabControl.DefaultTabName = DefaultTabName; tabControl.ElementName = ElementName; tabControl.ModuleName = ResourceName; tabControl.TabControlLayout = TabControlLayoutEnum.Horizontal; tabControl.RememberSelectedTab = RememberSelectedTab; tabControl.AllowSubTabs = AllowSubTabs; // Set selected tab based on tab index int tabIndex = ValidationHelper.GetInteger(UIContext["TabIndex"], 0); if (tabIndex != 0) { tabControl.SelectedTab = tabIndex; tabControl.SelectFirstItemByDefault = false; } tabControl.OnTabCreated += tabControl_OnTabCreated; RegisterBreadcrumbsScript(); } } }
/// <summary> /// Creates collection of tabs which should be displayed to the user. /// </summary> private void GetTabs() { UITabs tabControl = CurrentMaster.Tabs; bool checkUI = true; // Disable personalization for none-HTML editors if ((CustomOutputFormat == "copy") || (CustomOutputFormat == "move") || (CustomOutputFormat == "link") || (CustomOutputFormat == "relationship") || (CustomOutputFormat == "selectpath")) { checkUI = false; } else if (IsLiveSite) { // Ensure personalization of the HTML editor on the live site checkUI = ValidationHelper.GetBoolean(SettingsHelper.AppSettings["CKEditor:PersonalizeToolbarOnLiveSite"], false); } if (checkUI) { if ((OutputFormat == OutputFormatEnum.HTMLMedia) && !MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.WYSIWYGEditor", "InsertImageOrMedia")) { ScriptHelper.RegisterStartupScript(this, typeof(string), "frameLoad", ScriptHelper.GetScript("if (window.parent.frames['insertContent']) { window.parent.frames['insertContent'].location= '" + URLHelper.ResolveUrl(UIHelper.GetAccessDeniedUrl("CMS.WYSIWYGEditor", null, "InsertImageOrMedia")) + "';} ")); return; } if ((OutputFormat == OutputFormatEnum.HTMLLink) && !MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.WYSIWYGEditor", "InsertLink")) { ScriptHelper.RegisterStartupScript(this, typeof(string), "frameLoad", ScriptHelper.GetScript("if (window.parent.frames['insertContent']) { window.parent.frames['insertContent'].location= '" + URLHelper.ResolveUrl(UIHelper.GetAccessDeniedUrl("CMS.WYSIWYGEditor", null, "InsertLink")) + "';} ")); return; } if ((CustomOutputFormat == "linkdoc") && !(MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.Content", "New.LinkExistingDocument") && MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.Content", "New"))) { ScriptHelper.RegisterStartupScript(this, typeof(string), "frameLoad", ScriptHelper.GetScript("if (window.parent.frames['insertContent']) { window.parent.frames['insertContent'].location= '" + URLHelper.ResolveUrl(UIHelper.GetAccessDeniedUrl("CMS.Content", null, "New.LinkExistingDocument")) + "';} ")); return; } } // Attachments if ((CustomOutputFormat == "") && (!HasMetaFileObjectInfo) && !HideAttachments && (OutputFormat != OutputFormatEnum.NodeGUID) && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "AttachmentsTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("general.attachments"), RedirectUrl = GetFilePath("Tabs_Media.aspx", "source", CMSDialogHelper.GetMediaSource(MediaSourceEnum.DocumentAttachments)) }); if (SelectedTab == "attachments") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if ((CustomOutputFormat == "") && (HasMetaFileObjectInfo) && !HideAttachments && (OutputFormat != OutputFormatEnum.NodeGUID) && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "MetafilesTab"))) { // Metafile attachments tabControl.AddTab(new UITabItem() { Text = GetString("general.attachments"), RedirectUrl = GetFilePath("Tabs_Media.aspx", "source", CMSDialogHelper.GetMediaSource(MediaSourceEnum.MetaFile)) }); if (SelectedTab == "attachments") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if (SelectedTab == "attachments") { SelectedTab = "web"; } // Content if (!HideContent && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "ContentTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("general.content"), RedirectUrl = GetFilePath("Tabs_Media.aspx", "source", CMSDialogHelper.GetMediaSource(MediaSourceEnum.Content)) }); if (SelectedTab == "content") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if (SelectedTab == "content") { SelectedTab = "web"; } // Media libraries if ((CustomOutputFormat == "") && !HideMediaLibraries && (OutputFormat != OutputFormatEnum.NodeGUID) && ModuleManager.IsModuleLoaded(ModuleName.MEDIALIBRARY) && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "MediaLibrariesTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("dialogs.header.libraries"), RedirectUrl = GetMediaLibrariesPath() }); if (SelectedTab == "libraries") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if (SelectedTab == "libraries") { SelectedTab = "web"; } // Web if ((CustomOutputFormat == "") && !HideWeb && (OutputFormat != OutputFormatEnum.NodeGUID) && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "WebTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("dialogs.header.web"), RedirectUrl = (OutputFormat == OutputFormatEnum.BBLink) || (OutputFormat == OutputFormatEnum.HTMLLink) ? GetFilePath("Tabs_WebLink.aspx") : GetFilePath("Tabs_Web.aspx") }); if (SelectedTab == "web") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } // Anchor & E-mail if ((CustomOutputFormat == "") && ((OutputFormat == OutputFormatEnum.BBLink) || (OutputFormat == OutputFormatEnum.HTMLLink) || (OutputFormat == OutputFormatEnum.Custom))) { // Anchor if (!HideAnchor && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "AnchorTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("dialogs.header.anchor"), RedirectUrl = GetFilePath("Tabs_Anchor.aspx") }); if (SelectedTab == "anchor") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if (SelectedTab == "anchor") { SelectedTab = "web"; } // E-mail if (!HideEmail && (!checkUI || currentUser.IsAuthorizedPerUIElement("CMS.MediaDialog", "EmailTab"))) { tabControl.AddTab(new UITabItem() { Text = GetString("general.email"), RedirectUrl = GetFilePath("Tabs_Email.aspx") }); if (SelectedTab == "email") { mSelectedTabIndex = tabControl.TabItems.Count - 1; } } else if (SelectedTab == "email") { SelectedTab = "web"; } } string selectedUrl = ((mSelectedTabIndex > 0) ? tabControl.TabItems[mSelectedTabIndex].RedirectUrl : ((tabControl.TabItems.Count > 0) ? tabControl.TabItems[0].RedirectUrl : String.Empty)); if (!String.IsNullOrEmpty(selectedUrl)) { ScriptHelper.RegisterStartupScript(this, typeof(string), "frameLoad", ScriptHelper.GetScript("if (window.parent.frames['insertContent']) { window.parent.frames['insertContent'].location= '" + selectedUrl.Replace("&", "&").Replace("'", "%27") + "';} ")); } // No tab is displayed -> load UI Not available if (tabControl.TabItems.Count == 0) { ScriptHelper.RegisterStartupScript(this, typeof(string), "frameLoad", ScriptHelper.GetScript("if (window.parent.frames['insertContent']) { window.parent.frames['insertContent'].location= '" + URLHelper.ResolveUrl(UIHelper.GetInformationUrl("uiprofile.uinotavailable")) + "';} ")); } else if (tabControl.TabItems.Count == 1) { tabControl.Visible = false; // Hide empty space because of hidden tab control ScriptHelper.RegisterStartupScript(this, typeof(string), "headerFrameHide", ScriptHelper.GetScript("parent.$cmsj('#rowsFrameset').attr('rows','" + CMSPage.TitleOnlyHeight + ", *, " + CMSPage.FooterFrameHeight + "')")); } }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { // No actions if processing is stopped } else { SetHeaderControls(paneTitle); var isDesign = PortalContext.ViewMode.IsDesign(true); if (isDesign) { paneContent.RenderAs = HtmlTextWriterTag.Div; } // Handle title ManagePaneTitle(paneTitle, true); // Show dialog footer only when used in a dialog layoutElem.DisplayFooter = DisplayFooter; tabControl = paneTabs.FindControl("tabsElem") as UITabs; // Ensure correct property UIContext["DisplayTitleInTabs"] = GetValue("DisplayTitleInTabs"); if (tabControl != null) { tabControl.ElementName = ElementName; tabControl.ModuleName = ResourceName; tabControl.DefaultTabName = DefaultTabName; tabControl.TabControlLayout = TabControlLayoutEnum.Vertical; tabControl.RememberSelectedTab = RememberSelectedTab && !isDesign; tabControl.AllowSubTabs = AllowSubTabs; // Set selected tab based on tab index int tabIndex = ValidationHelper.GetInteger(UIContext["TabIndex"], 0); if (tabIndex != 0) { tabControl.SelectedTab = tabIndex; tabControl.SelectFirstItemByDefault = false; } tabControl.OnTabCreated += tabControl_OnTabCreated; RegisterBreadcrumbsScript(); } } }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { // No actions if processing is stopped } else { ManagePaneTitle(paneTabs, false); // Show dialog footer only when used in a dialog layoutElem.DisplayFooter = DisplayFooter; if (IsDialog) { paneTabs.PaneClass = "DialogsPageHeader"; } tabControl = paneTabs.FindControl("tabsElem") as UITabs; if (tabControl != null) { tabControl.DefaultTabName = DefaultTabName; tabControl.ElementName = ElementName; tabControl.ModuleName = ResourceName; tabControl.TabControlLayout = TabControlLayoutEnum.Horizontal; tabControl.RememberSelectedTab = RememberSelectedTab; tabControl.AllowSubTabs = AllowSubTabs; // Set selected tab based on tab index int tabIndex = ValidationHelper.GetInteger(UIContext["TabIndex"], 0); if (tabIndex != 0) { tabControl.SelectedTab = tabIndex; tabControl.SelectFirstItemByDefault = false; } tabControl.OnTabCreated += tabControl_OnTabCreated; RegisterBreadcrumbsScript(); } } }
protected void Page_Load(object sender, EventArgs e) { // Get query parameters int moduleId = QueryHelper.GetInteger("moduleid", 0); int elementId = QueryHelper.GetInteger("elementid", 0); int parentId = QueryHelper.GetInteger("parentid", 0); string currentElement = ""; bool hideRolesTab = false; // Get edited element UIElementInfo elemInfo = UIElementInfoProvider.GetUIElementInfo(elementId); if (elemInfo != null) { // Get current element display name currentElement = elemInfo.ElementDisplayName; // Check if editing group element if (elemInfo.ElementName.ToLowerCSafe().StartsWithCSafe("group.")) { // Get parent module ResourceInfo module = elemInfo.Parent as ResourceInfo; // Check if editing element under wysiwyg module hideRolesTab = (module != null) && (module.ResourceName.EqualsCSafe("cms.wysiwygeditor", true)); } } // Setup breadcrumbs string[,] pageTitleTabs = new string[2, 3]; pageTitleTabs[0, 0] = GetString("resource.ui.element"); pageTitleTabs[0, 1] = "~/CMSModules/Modules/Pages/Development/Module_UI_Frameset.aspx?moduleid=" + moduleId; pageTitleTabs[0, 2] = "content"; pageTitleTabs[1, 0] = ResHelper.LocalizeString(currentElement); pageTitleTabs[1, 1] = ""; pageTitleTabs[1, 2] = ""; CurrentMaster.Title.Breadcrumbs = pageTitleTabs; // Setup Tabs if no creating and no parent element if (parentId > 0) { UITabs tabs = CurrentMaster.Tabs; tabs.UrlTarget = "editcontent"; // Create General tab tabs.TabItems.Add(new TabItem() { Text = GetString("general.general"), OnClientClick = "SaveTab(0);SetHelpTopic('helpTopic', 'resource_ui_general');", RedirectUrl = "Module_UI_General.aspx?moduleID=" + moduleId + "&elementId=" + elementId + "&parentId=" + parentId }); CurrentMaster.Title.HelpTopicName = "resource_ui_general"; CurrentMaster.Title.HelpName = "helpTopic"; if (!hideRolesTab) { // Create roles tab tabs.TabItems.Add(new TabItem() { Text = GetString("general.roles"), OnClientClick = "SaveTab(1);SetHelpTopic('helpTopic', 'resource_ui_roles');", RedirectUrl = "Module_UI_Roles.aspx?moduleID=" + moduleId + "&elementId=" + elementId + "&parentId=" + parentId }); int selectedTab = QueryHelper.GetInteger("tabindex", 0); tabs.SelectedTab = selectedTab; CurrentMaster.Title.HelpTopicName = (selectedTab == 0) ? "resource_ui_general" : "resource_ui_roles"; } CurrentMaster.HeadElements.Visible = true; CurrentMaster.HeadElements.Text = ScriptHelper.GetScript("function SaveTab(tabIndex){\n if ((window.parent != null) && (window.parent.parent != null) && (window.parent.parent.frames['tree'])){\n window.parent.parent.frames['tree'].setTab(tabIndex);\n}}"); } }