/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> private void BindData() { // Populate the "Add Module" Data ModulesDB m = new ModulesDB(); SqlDataReader drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(portalSettings.PortalID); try { // if(this.ArePropertiesEditable) // { // while(drCurrentModuleDefinitions.Read()) // { // moduleType.Items.Add(new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(),drCurrentModuleDefinitions["ModuleDefID"].ToString() + "|" + GetHelpPath(drCurrentModuleDefinitions["DesktopSrc"].ToString()))); // } // } // else // { while (drCurrentModuleDefinitions.Read()) { // Added by Mario Endara <*****@*****.**> 2004/11/04 // only users members of the "Amins" role can add Admin modules to a Tab if (PortalSecurity.IsInRoles("Admins") == true || !(bool.Parse(drCurrentModuleDefinitions["Admin"].ToString()))) { moduleType.Items.Add(new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(), drCurrentModuleDefinitions["ModuleDefID"].ToString() + "|" + GetHelpPath(drCurrentModuleDefinitions["DesktopSrc"].ToString()))); } } // } } finally { drCurrentModuleDefinitions.Close(); } }
/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> /// <remarks> /// </remarks> private void BindData() { // Populate the "Add Module" Data var m = new ModulesDB(); var drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(this.PortalSettings.PortalID); try { // if(this.ArePropertiesEditable) // { // while(drCurrentModuleDefinitions.Read()) // { // moduleType.Items.Add(new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(),drCurrentModuleDefinitions["ModuleDefID"].ToString() + "|" + GetHelpPath(drCurrentModuleDefinitions["DesktopSrc"].ToString()))); // } // } // else // { while (drCurrentModuleDefinitions.Read()) { // Added by Mario Endara <*****@*****.**> 2004/11/04 // only users members of the "Amins" role can add Admin modules to a Tab if (PortalSecurity.IsInRoles("Admins") || !bool.Parse(drCurrentModuleDefinitions["Admin"].ToString())) { this.moduleType.Items.Add( new ListItem( drCurrentModuleDefinitions["FriendlyName"].ToString(), string.Format( "{0}|{1}", drCurrentModuleDefinitions["ModuleDefID"], GetHelpPath(drCurrentModuleDefinitions["DesktopSrc"].ToString())))); var actions = ModelServices.GetMVCActionModules(); foreach (var key in actions.Keys) { this.moduleType.Items.Add(new ListItem(key, actions[key])); } } } // } } finally { drCurrentModuleDefinitions.Close(); } }
private void BindModules() { var asd = new PagesDB(); // Populate the "Add Module" Data var m = new ModulesDB(); var modules = new SortedList <string, string>(); var drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(this.PortalSettings.PortalID); var htmlId = "0"; try { foreach (var item in drCurrentModuleDefinitions) { if ((!modules.ContainsKey(item.FriendlyName)) && (PortalSecurity.IsInRoles("Admins") || !item.Admin)) { modules.Add( item.FriendlyName, item.ModuleDefId.ToString()); if (item.FriendlyName.ToString().Equals("HTML Content")) { htmlId = item.ModuleDefId.ToString(); } } } } finally { } this.ddlModules.DataSource = modules; this.ddlModules.DataTextField = "key"; this.ddlModules.DataValueField = "value"; this.ddlModules.DataBind(); }
/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> /// <remarks> /// </remarks> private void BindData() { var page = this.PortalSettings.ActivePage; // Populate Page Names, etc. this.tabName.Text = page.PageName; this.mobilePageName.Text = page.MobilePageName; this.showMobile.Checked = page.ShowMobile; // Populate the "ParentPage" Data var t = new PagesDB(); var items = t.GetPagesParent(this.PortalSettings.PortalID, this.PageID); this.parentPage.DataSource = items; this.parentPage.DataBind(); if (this.parentPage.Items.FindByValue(page.ParentPageID.ToString()) != null) { // parentPage.Items.FindByValue( tab.ParentPageID.ToString() ).Selected = true; this.parentPage.SelectedValue = page.ParentPageID.ToString(); } // Translate if (this.parentPage.Items.FindByText(" ROOT_LEVEL") != null) { this.parentPage.Items.FindByText(" ROOT_LEVEL").Text = General.GetString( "ROOT_LEVEL", "Root Level", this.parentPage); } // Populate checkbox list with all security roles for this portal // and "check" the ones already configured for this tab var users = new UsersDB(); var roles = users.GetPortalRoles(this.PortalSettings.PortalAlias); // Clear existing items in checkboxlist this.authRoles.Items.Clear(); foreach (var role in roles) { var item = new ListItem(); item.Text = role.Name; item.Value = role.Id.ToString(); if (page.AuthorizedRoles.LastIndexOf(item.Text) > -1) { item.Selected = true; } this.authRoles.Items.Add(item); } // Populate the "Add Module" Data var m = new ModulesDB(); var modules = new SortedList <string, string>(); var drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(this.PortalSettings.PortalID); //if (PortalSecurity.IsInRoles("Admins") || !bool.Parse(drCurrentModuleDefinitions["Admin"].ToString())) //{ var htmlId = "0"; try { while (drCurrentModuleDefinitions.Read()) { if ((!modules.ContainsKey(drCurrentModuleDefinitions["FriendlyName"].ToString())) && (PortalSecurity.IsInRoles("Admins") || !bool.Parse(drCurrentModuleDefinitions["Admin"].ToString()))) { modules.Add( // moduleType.Items.Add( // new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(), // drCurrentModuleDefinitions["ModuleDefID"].ToString())); drCurrentModuleDefinitions["FriendlyName"].ToString(), drCurrentModuleDefinitions["ModuleDefID"].ToString()); if (drCurrentModuleDefinitions["FriendlyName"].ToString().Equals("HTML Content")) { htmlId = drCurrentModuleDefinitions["ModuleDefID"].ToString(); } } } } finally { drCurrentModuleDefinitions.Close(); } //} // Dictionary<string, string> actions = ModelServices.GetMVCActionModules(); // foreach (string key in actions.Keys) { // modules.Add(key, actions[key]); // } this.moduleType.DataSource = modules; this.moduleType.DataBind(); this.moduleType.SelectedValue = htmlId; // Now it's the load is by ajax 1/september/2011 // Populate Top Pane Module Data //this.topList = this.GetModules("TopPane"); //this.topPane.DataBind(); //// Populate Left Hand Pane Module Data //this.leftList = this.GetModules("LeftPane"); //this.leftPane.DataBind(); //// Populate Content Pane Module Data //this.contentList = this.GetModules("ContentPane"); //this.contentPane.DataBind(); //// Populate Right Hand Module Data //this.rightList = this.GetModules("RightPane"); //this.rightPane.DataBind(); //// Populate Bottom Module Data //this.bottomList = this.GetModules("BottomPane"); //this.bottomPane.DataBind(); }
/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> /// <remarks> /// </remarks> private void BindData() { var page = this.PortalSettings.ActivePage; // Populate Page Names, etc. this.txtPageID.Text = page.PageID.ToString(); this.tabName.Text = page.PageName; this.friendlyUrl.Text = page.FriendlyURL; this.mobilePageName.Text = page.MobilePageName; this.showMobile.Checked = page.ShowMobile; this.lblCurrentPageLink.Text = HttpUrlBuilder.BuildUrl(page.PageID); // Populate the "ParentPage" Data var t = new PagesDB(); var items = t.GetPagesParent(this.PortalSettings.PortalID, this.PageID); this.parentPage.DataSource = items; this.parentPage.DataBind(); if (this.parentPage.Items.FindByValue(page.ParentPageID.ToString()) != null) { // parentPage.Items.FindByValue( tab.ParentPageID.ToString() ).Selected = true; this.parentPage.SelectedValue = page.ParentPageID.ToString(); } // Translate if (this.parentPage.Items.FindByText(" ROOT_LEVEL") != null) { this.parentPage.Items.FindByText(" ROOT_LEVEL").Text = General.GetString( "ROOT_LEVEL", "Root Level", this.parentPage); } // Populate checkbox list with all security roles for this portal // and "check" the ones already configured for this tab var users = new UsersDB(); var roles = users.GetPortalRoles(this.PortalSettings.PortalAlias); // Clear existing items in checkboxlist this.authRoles.Items.Clear(); foreach (var role in roles) { var item = new ListItem(); item.Text = role.Name; item.Value = role.Id.ToString(); if (page.AuthorizedRoles.LastIndexOf(item.Text) > -1) { item.Selected = true; } this.authRoles.Items.Add(item); } // Populate the "Add Module" Data var m = new ModulesDB(); var modules = new SortedList <string, string>(); var drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(this.PortalSettings.PortalID); var htmlId = "0"; try { foreach (var item in drCurrentModuleDefinitions) { if ((!modules.ContainsKey(item.FriendlyName)) && (PortalSecurity.IsInRoles("Admins") || !item.Admin)) { modules.Add( item.FriendlyName, item.ModuleDefId.ToString()); if (item.FriendlyName.ToString().Equals("HTML Content")) { htmlId = item.ModuleDefId.ToString(); } } } } finally { } this.moduleType.DataSource = modules; this.moduleType.DataBind(); this.moduleType.SelectedValue = htmlId; }
/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> private void BindData() { TabSettings tab = portalSettings.ActiveTab; // Populate Tab Names, etc. tabName.Text = tab.TabName; mobileTabName.Text = tab.MobileTabName; showMobile.Checked = tab.ShowMobile; // Populate the "ParentTab" Data TabsDB t = new TabsDB(); SqlDataReader dr = t.GetTabsParent(portalSettings.PortalID, TabID); parentTab.DataSource = dr; parentTab.DataBind(); dr.Close(); //by Manu, fixed bug 807858 if (parentTab.Items.FindByValue(tab.ParentTabID.ToString()) != null) { parentTab.Items.FindByValue(tab.ParentTabID.ToString()).Selected = true; } // Translate if (parentTab.Items.FindByText(" ROOT_LEVEL") != null) { parentTab.Items.FindByText(" ROOT_LEVEL").Text = Esperantus.Localize.GetString("ROOT_LEVEL", "Root Level", parentTab); } // added by Jonathan Fong 05/08/2004 to support LDAP // www.gt.com.au bool useMemberList = HttpContext.Current.User is System.Security.Principal.WindowsPrincipal; useMemberList |= System.Configuration.ConfigurationSettings.AppSettings["LDAPLogin"] != null ? true : false; if (useMemberList) { memRoles.Visible = true; authRoles.Visible = false; memRoles.Members = tab.AuthorizedRoles; } else { // Populate checkbox list with all security roles for this portal // and "check" the ones already configured for this tab UsersDB users = new UsersDB(); SqlDataReader roles = users.GetPortalRoles(portalSettings.PortalID); // Clear existing items in checkboxlist authRoles.Items.Clear(); ListItem allItem = new ListItem(); allItem.Text = "All Users"; if (tab.AuthorizedRoles.LastIndexOf("All Users") > -1) { allItem.Selected = true; } authRoles.Items.Add(allItem); // Authenticated user role added // 15 nov 2002 - by manudea ListItem authItem = new ListItem(); authItem.Text = "Authenticated Users"; if (tab.AuthorizedRoles.LastIndexOf("Authenticated Users") > -1) { authItem.Selected = true; } authRoles.Items.Add(authItem); // end authenticated user role added while (roles.Read()) { ListItem item = new ListItem(); item.Text = (string)roles["RoleName"]; item.Value = roles["RoleID"].ToString(); if ((tab.AuthorizedRoles.LastIndexOf(item.Text)) > -1) { item.Selected = true; } authRoles.Items.Add(item); } roles.Close(); //by Manu, fixed bug 807858 } // Populate the "Add Module" Data ModulesDB m = new ModulesDB(); SqlDataReader drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(portalSettings.PortalID); try { while (drCurrentModuleDefinitions.Read()) { if (PortalSecurity.IsInRoles("Admins") == true || !(bool.Parse(drCurrentModuleDefinitions["Admin"].ToString()))) { moduleType.Items.Add(new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(), drCurrentModuleDefinitions["ModuleDefID"].ToString())); } } } finally { drCurrentModuleDefinitions.Close(); } // Populate Right Hand Module Data rightList = GetModules("RightPane"); rightPane.DataBind(); // Populate Content Pane Module Data contentList = GetModules("ContentPane"); contentPane.DataBind(); // Populate Left Hand Pane Module Data leftList = GetModules("LeftPane"); leftPane.DataBind(); }
/// <summary> /// The BindData helper method is used to update the tab's /// layout panes with the current configuration information /// </summary> private void BindData() { PageSettings page = portalSettings.ActivePage; // Populate Page Names, etc. tabName.Text = page.PageName; mobilePageName.Text = page.MobilePageName; showMobile.Checked = page.ShowMobile; // Populate the "ParentPage" Data PagesDB t = new PagesDB(); IList <PageItem> items = t.GetPagesParent(portalSettings.PortalID, PageID); parentPage.DataSource = items; parentPage.DataBind(); if (parentPage.Items.FindByValue(page.ParentPageID.ToString()) != null) { //parentPage.Items.FindByValue( tab.ParentPageID.ToString() ).Selected = true; parentPage.SelectedValue = page.ParentPageID.ToString(); } // Translate if (parentPage.Items.FindByText(" ROOT_LEVEL") != null) { parentPage.Items.FindByText(" ROOT_LEVEL").Text = General.GetString("ROOT_LEVEL", "Root Level", parentPage); } // Populate checkbox list with all security roles for this portal // and "check" the ones already configured for this tab UsersDB users = new UsersDB(); IList <RainbowRole> roles = users.GetPortalRoles(portalSettings.PortalAlias); // Clear existing items in checkboxlist authRoles.Items.Clear(); foreach (RainbowRole role in roles) { ListItem item = new ListItem(); item.Text = role.Name; item.Value = role.Id.ToString(); if ((page.AuthorizedRoles.LastIndexOf(item.Text)) > -1) { item.Selected = true; } authRoles.Items.Add(item); } // Populate the "Add Module" Data ModulesDB m = new ModulesDB(); SqlDataReader drCurrentModuleDefinitions = m.GetCurrentModuleDefinitions(portalSettings.PortalID); try { while (drCurrentModuleDefinitions.Read()) { if (PortalSecurity.IsInRoles("Admins") == true || !(bool.Parse(drCurrentModuleDefinitions["Admin"].ToString()))) { moduleType.Items.Add( new ListItem(drCurrentModuleDefinitions["FriendlyName"].ToString(), drCurrentModuleDefinitions["ModuleDefID"].ToString())); } } } finally { drCurrentModuleDefinitions.Close(); } // Populate Right Hand Module Data rightList = GetModules("RightPane"); rightPane.DataBind(); // Populate Content Pane Module Data contentList = GetModules("ContentPane"); contentPane.DataBind(); // Populate Left Hand Pane Module Data leftList = GetModules("LeftPane"); leftPane.DataBind(); }