コード例 #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);
        }
コード例 #2
0
 public WebPageController(IWebPageService webPageService, ISectionService sectionService, IUrlRecordService urlRecordService, RoleManager <IdentityRole> roleManager)
 {
     _webPageService   = webPageService;
     _sectionService   = sectionService;
     _urlRecordService = urlRecordService;
     _roleManager      = roleManager;
 }
コード例 #3
0
 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);
 }
コード例 #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);
        }
コード例 #5
0
 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;
 }
コード例 #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);
     }
 }
コード例 #7
0
 public ContactFormSectionReadOnlyModel(Section section, IWebPageService webPageService, IHttpContextAccessor httpContextAccessor)
     : base(section, webPageService, httpContextAccessor)
 {
 }
コード例 #8
0
 public WorkHistorySectionReadOnlyModel(Section section, IWebPageService webPageService, IHttpContextAccessor httpContextAccessor)
     : base(section, webPageService, httpContextAccessor)
 {
 }
コード例 #9
0
 public SectionBaseController(IWebPageService webPageService, ISectionService sectionService, IWebHelper webHelper)
 {
     _webPageService = webPageService;
     _sectionService = sectionService;
     _webHelper      = webHelper;
 }
コード例 #10
0
 public NavigationService(IWebPageService webPageService)
 {
     _webPageService = webPageService;
 }
コード例 #11
0
 public HistoryController(IWebPageService webPageService)
 {
     _webPageService = webPageService;
 }
コード例 #12
0
 public WebPageController(IWebPageService webPageService, ISectionService sectionService)
 {
     _webPageService = webPageService;
     _sectionService = sectionService;
 }
コード例 #13
0
ファイル: SearchController.cs プロジェクト: e0gen/MultiSearch
 public SearchController(ISearchEngine searchEngine, IWebPageService webPageService)
 {
     _searchEngine   = searchEngine;
     _webPageService = webPageService;
 }
コード例 #14
0
 public WebPageController(IWebPageService webPageService, ISectionService sectionService, ILocalizedEntityService leSerive)
 {
     _webPageService = webPageService;
     _sectionService = sectionService;
     _leService      = leSerive;
 }
コード例 #15
0
 public HtmlContentController(ILanguageWebApi languageWebApi, ILocalizedEntityWebApi localizedEntityWebApi, ILocalizedEnitityHelperService localizedEntityHelperService, IWebPageService webPageService, ISectionService sectionService, IWebHelper webHelper) : base(webPageService, sectionService, webHelper)
 {
     _languageWebApi               = languageWebApi;
     _localizedEntityWebApi        = localizedEntityWebApi;
     _localizedEntityHelperService = localizedEntityHelperService;
 }