Exemple #1
0
        //*********************************************************************
        //
        // PopulateTabView method
        //
        // The PopulateTabView method dynamically populates a portal tab
        // with each module defined in the portal configuration.
        //
        //*********************************************************************

        private void PopulateTabView(int tabIndex)
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            // Ensure that the visiting user has access to the current page
            if (PortalSecurity.IsInRoles(portalSettings.ActiveTab.AuthorizedRoles) == false)
            {
                Response.Redirect("~/Admin/MobileAccessDenied.aspx");
            }

            // Obtain reference to container mobile tab
            MobilePortalTab view = (MobilePortalTab)TabView.Panes[tabIndex];

            // Dynamically populate the view
            if (portalSettings.ActiveTab.Modules.Count > 0)
            {
                // Loop through each entry in the configuration system for this tab
                foreach (ModuleSettings _moduleSettings in portalSettings.ActiveTab.Modules)
                {
                    // Only add the module if it support Mobile devices
                    if (_moduleSettings.ShowMobile)
                    {
                        MobilePortalModuleControl moduleControl = (MobilePortalModuleControl)Page.LoadControl(_moduleSettings.MobileSrc);
                        moduleControl.ModuleConfiguration = _moduleSettings;

                        view.Panes.Add(moduleControl);
                    }
                }
            }
        }
Exemple #2
0
        //*********************************************************************
        //
        // PopulateTabStrip method
        //
        // The PopulateTabStrip method is used to dynamically create and add
        // tabs for each tab view defined in the portal configuration.
        //
        //*********************************************************************

        private void PopulateTabStrip()
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            for (int i = 0; i < portalSettings.MobileTabs.Count; i++)
            {
                // Create a MobilePortalTab control for the tab,
                // and add it to the tab view.

                TabStripDetails tab = (TabStripDetails)portalSettings.MobileTabs[i];

                if (PortalSecurity.IsInRoles(tab.AuthorizedRoles))
                {
                    MobilePortalTab tabPanel = new MobilePortalTab();
                    tabPanel.Title = tab.TabName;

                    TabView.Panes.Add(tabPanel);
                }
            }
        }