public DashboardDataController(PageModelBuilder pageModelBuilder, IInitialiser initialiser, ICanReload[] reloads)
 {
     _initialiser = initialiser;
     _reloads     = reloads;
     _initialiser.Load();
     _pageModelBuilder = pageModelBuilder;
 }
Пример #2
0
        public ActionResult Page(string id)
        {
#if PUB
            var page = new PageModelBuilder <PubPage>(_db).GetPage(id);
#elif CMS
            var page = new PageModelBuilder <CmsPage>(_db).GetPage(id);
#endif
            if (page == null)
            {
                throw new HttpException(404, "Page not found");
            }

            var webpartHeaders = new StringBuilder();
            var havingWebPart  = false;

            page.ContentHtml.Content = _pageEngine.ReplaceTokens(
                page: page,
                webpartHeaders: webpartHeaders,
                havingWebPart: out havingWebPart,
                controllerContext: ControllerContext);

            ViewBag.HavingWebPart  = havingWebPart;
            ViewBag.WebpartHeaders = webpartHeaders.ToString();

#if CMS
            ViewBag.AccessMode = SecurityHelper.PageAccessMode(_db, page);
#endif

            ViewBag.NaviNode = page.NaviNode;
            ViewBag.BaseNode = CmsPageBase.FindBaseNode(page);

            var viewHtml = ViewRenderer.RenderViewToString(ControllerContext, "~/Core/Containers/Views/Cms/Page.cshtml", page);
            return(Content(viewHtml, "text/html"));
        }
Пример #3
0
 public RouteInfoService(RequestModelAccessor requestModelAccessor,
                         RouteRequestLookupInfoAccessor routeRequestLookupInfoAccessor,
                         IHttpContextAccessor httpContextAccessor, CountryService countryService,
                         ChannelService channelService, PageService pageService, PageModelBuilder pageModelBuilder)
 {
     _channelService                 = channelService;
     _requestModelAccessor           = requestModelAccessor;
     _routeRequestLookupInfoAccessor = routeRequestLookupInfoAccessor;
     _httpContextAccessor            = httpContextAccessor;
     _countryService                 = countryService;
     _pageService      = pageService;
     _pageModelBuilder = pageModelBuilder;
 }