public ManagementControlAttribute(ManagementType module, string location)
 {
     _module = module;
     _location = location;
     IsVisibleForAdministrator = true;
 }
        public static string GetAdministration(ManagementType managementType)
        {
            if (managementType == ManagementType.General)
                return ToAbsolute("~/management.aspx") + string.Empty;

            return ToAbsolute("~/management.aspx") + "?" + "type=" + ((int)managementType).ToString();
        }
 protected string GetNavigationUrl(ManagementType module)
 {
     return CommonLinkUtility.GetAdministration(module);
 }
 private static bool IsModuleVisible(ManagementType type)
 {
     return SetupInfo.IsVisibleSettings(type.ToString());
 }
 protected string GetPageTitle(ManagementType module)
 {
     return HeaderStringHelper.GetPageTitle(GetNavigationTitle(module));
 }
 protected string GetNavigationTitle(ManagementType module)
 {
     switch (module)
     {
         case ManagementType.General:
             return Resource.GeneralSettings;
         case ManagementType.Statistic:
             return Resource.StatisticsTitle;
         case ManagementType.AuditTrail:
             return AuditResource.AuditTrailNav;
         case ManagementType.LoginHistory:
             return AuditResource.LoginHistoryNav;
         default:
             return Resource.ResourceManager.GetString(module.ToString()) ?? module.ToString();
     }
 }
        protected bool DisplayModule(ManagementType module)
        {
            switch (module)
            {
                case ManagementType.Migration:
                    return (ConfigurationManager.AppSettings["web.migration.status"] == "true") && TransferRegions.Count > 1;

                case ManagementType.Backup:
                    return !TenantAccess.Anyone && SetupInfo.IsVisibleSettings(module.ToString());

                default:
                    return SetupInfo.IsVisibleSettings(module.ToString());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Form.Attributes.Add("autocomplete", "off");

            Master.DisabledSidePanel = false;

            SideNavigation.Controls.Add(LoadControl(ManagementNavigation.Location));

            _managementType = ManagementType.General;
            if (!String.IsNullOrEmpty(Request["type"]))
            {
                try
                {
                    _managementType = (ManagementType)Convert.ToInt32(Request["type"]);
                }
                catch
                {
                    _managementType = ManagementType.General;
                }
            }

            var standalone = CoreContext.Configuration.Standalone;

            //content
            switch (_managementType)
            {
                case ManagementType.Mail:

                    if (!(standalone || SetupInfo.IsVisibleSettings<MailSettings>()))
                        Response.Redirect("~/", true);

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.SmtpSettings);
                    _settingsContainer.Body.Controls.Add(LoadControl(MailSettings.Location));
                    break;

                case ManagementType.Statistic:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.StatisticsTitle);
                    _settingsContainer.Body.Controls.Add(LoadControl(ProductQuotes.Location));
                    _settingsContainer.Body.Controls.Add(LoadControl(VisitorsChart.Location));
                    break;

                case ManagementType.Account:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Backup);
                    _settingsContainer.Body.Controls.Add(LoadControl(Backup.Location));
                    break;

                case ManagementType.Customization:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Customization);

                    //greeting settings
                    _settingsContainer.Body.Controls.Add(LoadControl(GreetingSettings.Location));

                    //naming people
                    _settingsContainer.Body.Controls.Add(LoadControl(NamingPeopleSettings.Location));

                    //color themes settings
                    _settingsContainer.Body.Controls.Add(LoadControl(ColorThemes.Location));

                    break;

                case ManagementType.AccessRights:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.AccessRights);
                    _settingsContainer.Body.Controls.Add(LoadControl(AccessRights.Location));
                    break;

                case ManagementType.HelpCenter:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.HelpCenter);
                    _settingsContainer.Body.Controls.Add(LoadControl(Help.Location));
                    break;

                case ManagementType.ProductsAndInstruments:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.ProductsAndInstruments);
                    _settingsContainer.Body.Controls.Add(LoadControl(ProductsAndInstruments.Location));
                    break;

                case ManagementType.AuthorizationKeys:

                    if (!standalone)
                        Response.Redirect("~/", true);

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.ThirdPartyAuthorization);
                    _settingsContainer.Body.Controls.Add(LoadControl(AuthorizationKeys.Location));
                    _settingsContainer.Body.Controls.Add(LoadControl(SmtpSettings.Location));
                    break;

                default:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.GeneralSettings);

                    var settingsControl = LoadControl(StudioSettings.Location) as StudioSettings;
                    _settingsContainer.Body.Controls.Add(settingsControl);
                    break;
            }
        }
 protected string GetNavigationTitle(ManagementType module)
 {
     switch (module)
     {
         case ManagementType.Statistic:
             return Resource.StatisticsTitle;
         case ManagementType.AuditTrail:
             return AuditResource.AuditTrailNav;
         case ManagementType.LoginHistory:
             return AuditResource.LoginHistoryNav;
         case ManagementType.PortalSecurity:
             return Resource.PortalSecurity;
         case ManagementType.SmtpSettings:
             return Resource.SmtpSettings;
         case ManagementType.FullTextSearch:
             return Resource.FullTextSearchSettings;
         case ManagementType.DeletionPortal:
             return Resource.DeactivationDeletionPortal;
         case ManagementType.DocService:
             return Resource.DocService;
         default:
             return Resource.ResourceManager.GetString(module.ToString()) ?? module.ToString();
     }
 }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var studioMaster = (StudioTemplate)Master;
            studioMaster.DisabledSidePanel = true;

            _managementType = ManagementType.General;
            if (!String.IsNullOrEmpty(Request["type"]))
            {
                try
                {
                    _managementType = (ManagementType)Convert.ToInt32(Request["type"]);
                }
                catch
                {
                    _managementType = ManagementType.General;
                }
            }

            var standalone = CoreContext.Configuration.Standalone;            

            #region top navigation

            var topNavPanel = studioMaster.TopNavigationPanel;
            topNavPanel.CustomTitle = Resources.Resource.Administration;
            topNavPanel.CustomTitleURL = CommonLinkUtility.GetAdministration(ManagementType.General);
            topNavPanel.CustomTitleIconURL = WebImageSupplier.GetAbsoluteWebPath("settings.png");

            //general
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name = Resources.Resource.GeneralSettings,
                URL = CommonLinkUtility.GetAdministration(ManagementType.General),
                Selected = (_managementType == ManagementType.General)
            });

            //access rights
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name = Resources.Resource.AccessRights,
                URL = CommonLinkUtility.GetAdministration(ManagementType.AccessRights),
                Selected = (_managementType == ManagementType.AccessRights)
            });

            //customization
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name = Resources.Resource.Customization,
                URL = CommonLinkUtility.GetAdministration(ManagementType.Customization),
                Selected = (_managementType == ManagementType.Customization)
            });


            //mail  
            if (SetupInfo.IsVisibleSettings<MailSettings>() || standalone)
            {
                topNavPanel.NavigationItems.Add(new NavigationItem()
                {
                    Name = Resources.Resource.SmtpSettings,
                    URL = CommonLinkUtility.GetAdministration(ManagementType.Mail),
                    Selected = (_managementType == ManagementType.Mail)
                });
            }

            //account
            if (!standalone && SetupInfo.IsVisibleSettings<Backup>() && CoreContext.TenantManager.GetCurrentTenant().OwnerId == SecurityContext.CurrentAccount.ID)
            {   
                topNavPanel.NavigationItems.Add(new NavigationItem()
                {
                    Name = Resources.Resource.Backup,
                    URL = CommonLinkUtility.GetAdministration(ManagementType.Account),
                    Selected = (_managementType == ManagementType.Account)
                });
            }

            //statistic
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name = Resources.Resource.Statistic,
                URL = CommonLinkUtility.GetAdministration(ManagementType.Statistic),
                Selected = (_managementType == ManagementType.Statistic)
            });

            //tariff
            if (!standalone && SetupInfo.IsVisibleSettings<TariffSettings>())
            {
                topNavPanel.NavigationItems.Add(new NavigationItem()
                {
                    Name = Resources.Resource.TariffSettings,
                    URL = CommonLinkUtility.GetAdministration(ManagementType.Tariff),
                    Selected = (_managementType == ManagementType.Tariff)
                });
            }

            
            #endregion

            _settingsContainer.BreadCrumbs = new List<BreadCrumb>();
            _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.Administration, NavigationUrl = CommonLinkUtility.GetAdministration(ManagementType.General) });


            //content
            switch (_managementType)
            {
                case ManagementType.Mail:
                    if (!(standalone || SetupInfo.IsVisibleSettings<MailSettings>()))
                        Response.Redirect("~/", true);

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.SmtpSettings, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.SmtpSettings });
                    _settingsContainer.Body.Controls.Add(LoadControl(MailSettings.Location));
                    break;
                   
                case ManagementType.Tariff:
                    if (standalone)
                        Response.Redirect("~/", true);


                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.TariffSettings, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.TariffSettings });
                    _settingsContainer.Body.Controls.Add(LoadControl(TariffSettings.Location));
                    break;

                case ManagementType.Statistic:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.StatisticsTitle, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.StatisticsTitle });
                    _settingsContainer.Body.Controls.Add(LoadControl(ProductQuotes.Location));
                    _settingsContainer.Body.Controls.Add(LoadControl(VisitorsChart.Location));
                    break;

                case ManagementType.Account:

                    //No backup in standalone..
                    if (standalone)
                        Response.Redirect("~/", true);

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Backup, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.Backup });
                    _settingsContainer.Body.Controls.Add(LoadControl(Backup.Location));
                    break;

                case ManagementType.Customization:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Customization, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.Customization });

                    //greeting settings
                    _settingsContainer.Body.Controls.Add(LoadControl(GreetingSettings.Location));

                    //naming people
                    _settingsContainer.Body.Controls.Add(LoadControl(NamingPeopleSettings.Location));

                    //skin settings
                    _settingsContainer.Body.Controls.Add(LoadControl(SkinSettings.Location));

                    break;

                case ManagementType.AccessRights:

                    Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.AccessRights, null, null);
                    _settingsContainer.BreadCrumbs.Add(new BreadCrumb() { Caption = Resources.Resource.AccessRights });
                    _settingsContainer.Body.Controls.Add(LoadControl(AccessRights.Location));
                    break;

                case ManagementType.General:
                default:

                    this.Page.Title = HeaderStringHelper.GetPageTitle(Resources.Resource.Administration, null, null);
                    _settingsContainer.BreadCrumbs.Add(new ASC.Web.Controls.BreadCrumb() { Caption = Resources.Resource.Administration});         

                    var settingsControl = LoadControl(StudioSettings.Location) as StudioSettings;
                    _settingsContainer.Body.Controls.Add(settingsControl);
                    break;
            }
        }
        public static string GetAdministration(ManagementType managementType)
        {
            var query = "";
            if (managementType == ManagementType.General)
                return VirtualPathUtility.ToAbsolute("~/management.aspx") + query;

            return VirtualPathUtility.ToAbsolute("~/management.aspx") + query + (String.IsNullOrEmpty(query) ? "?" : "&") + "type=" + ((int) managementType).ToString();
        }
 public ManagementControlAttribute(ManagementType module, string location)
 {
     Module   = module;
     Location = location;
 }
 public string GetNavigationUrl(ManagementType module)
 {
     return(CommonLinkUtility.GetAdministration(module));
 }