public async Task AddDataAsync() { DataProviderGetRecords <SiteDefinition> info = await SiteDefinition.GetSitesAsync(0, 0, null, null); SiteDomain_List = (from s in info.Data orderby s.SiteDomain select new SelectionItem <string>() { Text = s.SiteDomain, Value = s.SiteDomain, Tooltip = this.__ResStr("switchSite", "Switch to site \"{0}\"", s.SiteDomain), }).ToList(); SiteDomain = Manager.CurrentSite.SiteDomain; ControlPanelConfigData config = await ControlPanelConfigDataProvider.GetConfigAsync(); UserId_List = config.Users; UserId = Manager.UserId; int superuserRole = Resource.ResourceAccess.GetSuperuserRoleId(); if (Manager.UserRoles != null && Manager.UserRoles.Contains(superuserRole)) { SuperuserCurrent = true;// the current user is a superuser } else if (Manager.HasSuperUserRole) { SuperuserStillActive = true; } else { SuperuserStillActive = false; } }
public async Task AddSupportAsync(YetaWFManager manager) { ScriptManager scripts = manager.ScriptManager; string areaName = AreaRegistration.CurrentPackage.AreaName; ControlPanelConfigData config = await ControlPanelConfigDataProvider.GetConfigAsync(); scripts.AddConfigOption(areaName, "PageControlMod", PageControlMod); scripts.AddConfigOption(areaName, "W3CUrl", config.W3CUrl); }
public async Task <ModuleAction> GetAction_W3CValidationAsync() { if (Manager.CurrentPage == null) { return(null); } if (Manager.IsLocalHost) { return(null); } ControlPanelConfigData config = await ControlPanelConfigDataProvider.GetConfigAsync(); if (string.IsNullOrWhiteSpace(config.W3CUrl)) { return(null); } if (!config.W3CUrl.Contains("{0}")) { return(null); } return(new ModuleAction(this) { Url = string.Format(config.W3CUrl, Manager.CurrentPage.EvaluatedCanonicalUrl), Image = await CustomIconAsync("W3CValidator.png"), Name = "W3CValidate", LinkText = this.__ResStr("modW3CValLink", "W3C Validation"), MenuText = this.__ResStr("modW3CValText", "W3C Validation"), Tooltip = this.__ResStr("modW3CValTooltip", "Use W3C Validation service to validate the current page - The page must be accessible to the remote service as an anonymous user"), Legend = this.__ResStr("modW3CValLegend", "Uses the defined W3C Validation service to validate a page - The page must be accessible to the remote service as an anonymous user"), Category = ModuleAction.ActionCategoryEnum.Read, Mode = ModuleAction.ActionModeEnum.Any, Location = ModuleAction.ActionLocationEnum.NoAuto | ModuleAction.ActionLocationEnum.MainMenu | ModuleAction.ActionLocationEnum.ModuleLinks | ModuleAction.ActionLocationEnum.ModuleMenu, Style = ModuleAction.ActionStyleEnum.NewWindow, DontFollow = true, }); }