コード例 #1
0
ファイル: AddTab.ascx.cs プロジェクト: arrioja/shared-citroen
        /// <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 "ParentTab" Data
            TabsDB        t  = new TabsDB();
            SqlDataReader dr = t.GetTabsParent(portalSettings.PortalID, TabID);

            parentTabDropDown.DataSource = dr;
            parentTabDropDown.DataBind();
            dr.Close();             //by Manu, fixed bug 807858

            //Preselects current tab as parent
// Comment out old code for Grischa Brockhaus
//			int currentTab = this.portalSettings.ActiveTab.TabID;
//			if (parentTabDropDown.Items.FindByValue(parentTabDropDown.ToString()) != null)
//				parentTabDropDown.Items.FindByValue(parentTabDropDown.ToString()).Selected = true;

            // Changes for Grischa Brockhaus copied by Mike Stone 7/1/2005
            int currentTab = this.portalSettings.ActiveTab.TabID;

            if (parentTabDropDown.Items.FindByValue(currentTab.ToString()) != null)
            {
                parentTabDropDown.Items.FindByValue(currentTab.ToString()).Selected = true;
            }

            // Translate
            if (parentTabDropDown.Items.FindByText(" ROOT_LEVEL") != null)
            {
                parentTabDropDown.Items.FindByText(" ROOT_LEVEL").Text = Esperantus.Localize.GetString("ROOT_LEVEL", "Root Level", parentTabDropDown);
            }
        }
コード例 #2
0
ファイル: AddTab.aspx.cs プロジェクト: arrioja/shared-citroen
        /// <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       = "New Tab";
            mobileTabName.Text = "";
            showMobile.Checked = false;

            // 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

            // 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
            }
        }
コード例 #3
0
        /// <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();
        }