protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts("~/UserControls/Management/DefaultPageSettings/js/defaultpage.js");

            DefaultPages = new List <DefaultStartPageWrapper>();

            var defaultPageSettings = StudioDefaultPageSettings.Load();

            DefaultProductID = defaultPageSettings.DefaultProductID;

            var products = WebItemManager.Instance.GetItemsAll <IProduct>().Where(p => p.Visible);

            foreach (var p in products)
            {
                var productInfo = WebItemSecurity.GetSecurityInfo(p.ID.ToString());
                if (productInfo.Enabled)
                {
                    DefaultPages.Add(new DefaultStartPageWrapper
                    {
                        ProductID   = p.ID,
                        DisplayName = p.Name,
                        ProductName = p.GetSysName(),
                        IsSelected  = DefaultProductID.Equals(p.ID)
                    });
                }
            }

            DefaultPages.Add(new DefaultStartPageWrapper
            {
                ProductID   = defaultPageSettings.FeedModuleID,
                DisplayName = Resources.UserControlsCommonResource.FeedTitle,
                ProductName = "feed",
                IsSelected  = DefaultProductID.Equals(defaultPageSettings.FeedModuleID)
            });

            DefaultPages.Add(new DefaultStartPageWrapper
            {
                ProductID   = Guid.Empty,
                DisplayName = Resources.Resource.DefaultPageSettingsChoiseOfProducts,
                ProductName = string.Empty,
                IsSelected  = DefaultProductID.Equals(Guid.Empty)
            });

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts("~/UserControls/Management/DefaultPageSettings/js/defaultpage.js");

            DefaultPages = new List <DefaultStartPageWrapper>();

            var defaultPageSettings = StudioDefaultPageSettings.Load();

            DefaultProductID = defaultPageSettings.DefaultProductID;

            var products = WebItemManager.Instance.GetItemsAll <IProduct>().Where(p => p.Visible);

            foreach (var p in products)
            {
                var productInfo = WebItemSecurity.GetSecurityInfo(p.ID.ToString());
                if (productInfo.Enabled)
                {
                    DefaultPages.Add(new DefaultStartPageWrapper
                    {
                        ProductID   = p.ID,
                        DisplayName = p.Name,
                        ProductName = p.GetSysName(),
                        IsSelected  = DefaultProductID.Equals(p.ID)
                    });
                }
            }

            var addons        = WebItemManager.Instance.GetItemsAll <IAddon>().Where(a => a.Visible && a.ID != WebItemManager.VoipModuleID);
            var isEnabledTalk = ConfigurationManagerExtension.AppSettings["web.talk"] ?? "false";

            foreach (var a in addons)
            {
                var productInfo = WebItemSecurity.GetSecurityInfo(a.ID.ToString());
                if (a.GetSysName() == "talk" && isEnabledTalk == "false")
                {
                    continue;
                }
                if (productInfo.Enabled)
                {
                    DefaultPages.Add(new DefaultStartPageWrapper
                    {
                        ProductID   = a.ID,
                        DisplayName = a.Name,
                        ProductName = a.GetSysName(),
                        IsSelected  = DefaultProductID.Equals(a.ID)
                    });
                }
            }

            DefaultPages.Add(new DefaultStartPageWrapper
            {
                ProductID   = defaultPageSettings.FeedModuleID,
                DisplayName = UserControlsCommonResource.FeedTitle,
                ProductName = "feed",
                IsSelected  = DefaultProductID.Equals(defaultPageSettings.FeedModuleID)
            });

            DefaultPages.Add(new DefaultStartPageWrapper
            {
                ProductID   = Guid.Empty,
                DisplayName = Resource.DefaultPageSettingsChoiseOfProducts,
                ProductName = string.Empty,
                IsSelected  = DefaultProductID.Equals(Guid.Empty)
            });

            HelpLink = CommonLinkUtility.GetHelpLink();
        }