Exemple #1
0
        //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);
 }
Exemple #4
0
        //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;
 }
Exemple #6
0
 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);
     }
 }
Exemple #7
0
 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;
 }
Exemple #10
0
 public NavigationService(IWebPageService webPageService)
 {
     _webPageService = webPageService;
 }
 public HistoryController(IWebPageService webPageService)
 {
     _webPageService = webPageService;
 }
Exemple #12
0
 public WebPageController(IWebPageService webPageService, ISectionService sectionService)
 {
     _webPageService = webPageService;
     _sectionService = sectionService;
 }
Exemple #13
0
 public SearchController(ISearchEngine searchEngine, IWebPageService webPageService)
 {
     _searchEngine   = searchEngine;
     _webPageService = webPageService;
 }
Exemple #14
0
 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;
 }