//webpage public static WebPageModel ToModel(this WebPage entity, IWebPageService webPageService, ISectionService sectionService) { if (entity == null) { return(null); } bool userIsAdmin = webPageService.IsAdminCurrentUser(); bool userHasEditRights = webPageService.HasEditRights(entity.Id); bool userHasCreateRights = webPageService.HasCreateRights(entity.Id); var model = new WebPageModel() { Id = entity.Id, //SidebarVisible = entity.SidebarEnabled, UserHasCreateRights = userHasCreateRights, AvailableSections = sectionService.GetAvailableSections().Select(x => new SelectListItem { Text = x }) }; foreach (var sectionEntity in entity.Sections) { var sm = GetSectionModel(sectionEntity); sm.Id = sectionEntity.Id; sm.WebPage = sectionEntity.WebPage; sm.UserHasEditRights = userHasEditRights; sm.UserIsAdmin = userIsAdmin; model.Sections.Add(sm); } return(model); }
public WebPageController(IWebPageService webPageService, ISectionService sectionService, IUrlRecordService urlRecordService, RoleManager <IdentityRole> roleManager) { _webPageService = webPageService; _sectionService = sectionService; _urlRecordService = urlRecordService; _roleManager = roleManager; }
public WorkHistoryController(IWebPageService webPageService, ISectionService sectionService, IWorkContext workContext, IWebHelper webHelper, IResumesWebApi resumeManagementApi, ILogger <WorkHistoryController> logger) : base(webPageService, sectionService, webHelper) { _workContext = workContext; _resumeManagementApi = resumeManagementApi; _logger = logger; _resiliencyHelper = new ResiliencyHelper(_logger); }
//webpage public static WebPageFrontEndModel ToFrontEndModel(this WebPage entity, IWebPageService webPageService, ISectionService sectionService, ClaimsPrincipal user, int languageId, ILocalizedEntityService leService) { if (entity == null) { return(null); } bool userIsAdmin = user.IsInRole(SystemRoleNames.Administrators); bool userHasEditRights = webPageService.HasEditRights(entity.Id); bool userHasCreateRights = webPageService.HasCreateRights(entity.Id); var model = new WebPageFrontEndModel() { Id = entity.Id, VirtualPath = entity.VirtualPath, UserHasCreateRights = userHasCreateRights, AvailableSections = sectionService.GetAvailableSections() }; foreach (var sectionEntity in entity.Sections) { var sm = GetSectionModel(sectionEntity, languageId); sm.Id = sectionEntity.Id; //sm.WebPage = sectionEntity.WebPage; sm.UserHasEditRights = userHasEditRights; sm.UserIsAdmin = userIsAdmin; model.Sections.Add(sm); } return(model); }
public WebPageController(IWebsiteService websiteService, IWebPageService webPageService, ISectionService sectionService, IWorkContext workContext, IWebHelper webHelper, ILogger <WebPageController> logger) { _websiteService = websiteService; _webPageService = webPageService; _sectionService = sectionService; _workContext = workContext; _webHelper = webHelper; _logger = logger; }
public BaseReadOnlyModel(Section section, IWebPageService webPageService, IHttpContextAccessor httpContextAccessor) { if (section != null) { this.Id = section.Id; //this.WebPage = section.WebPage; this.UserHasEditRights = webPageService.HasEditRights(section.WebPageId); this.UserIsAdmin = httpContextAccessor.HttpContext.User.IsInRole(SystemRoleNames.Administrators); } }
public ContactFormSectionReadOnlyModel(Section section, IWebPageService webPageService, IHttpContextAccessor httpContextAccessor) : base(section, webPageService, httpContextAccessor) { }
public WorkHistorySectionReadOnlyModel(Section section, IWebPageService webPageService, IHttpContextAccessor httpContextAccessor) : base(section, webPageService, httpContextAccessor) { }
public SectionBaseController(IWebPageService webPageService, ISectionService sectionService, IWebHelper webHelper) { _webPageService = webPageService; _sectionService = sectionService; _webHelper = webHelper; }
public NavigationService(IWebPageService webPageService) { _webPageService = webPageService; }
public HistoryController(IWebPageService webPageService) { _webPageService = webPageService; }
public WebPageController(IWebPageService webPageService, ISectionService sectionService) { _webPageService = webPageService; _sectionService = sectionService; }
public SearchController(ISearchEngine searchEngine, IWebPageService webPageService) { _searchEngine = searchEngine; _webPageService = webPageService; }
public WebPageController(IWebPageService webPageService, ISectionService sectionService, ILocalizedEntityService leSerive) { _webPageService = webPageService; _sectionService = sectionService; _leService = leSerive; }
public HtmlContentController(ILanguageWebApi languageWebApi, ILocalizedEntityWebApi localizedEntityWebApi, ILocalizedEnitityHelperService localizedEntityHelperService, IWebPageService webPageService, ISectionService sectionService, IWebHelper webHelper) : base(webPageService, sectionService, webHelper) { _languageWebApi = languageWebApi; _localizedEntityWebApi = localizedEntityWebApi; _localizedEntityHelperService = localizedEntityHelperService; }