public TimetableController( IOrchardServices services, ITimetableService TimetableService, ITimetableAppointmentService TimetableAppointmentService, ITimetableSlugConstraint TimetableSlugConstraint, IFeedManager feedManager, IShapeFactory shapeFactory, IWorkContextAccessor workContextAccessor, IEnumerable<IHomePageProvider> homePageProviders, ISiteService siteService) { _services = services; _TimetableService = TimetableService; _TimetableAppointmentService = TimetableAppointmentService; _TimetableSlugConstraint = TimetableSlugConstraint; _feedManager = feedManager; _workContextAccessor = workContextAccessor; _siteService = siteService; _routableHomePageProvider = homePageProviders.SingleOrDefault(p => p.GetProviderName() == RoutableHomePageProvider.Name); Logger = NullLogger.Instance; Shape = shapeFactory; }
public TimetablePartHandler(IRepository<TimetablePartRecord> repository, IWorkContextAccessor workContextAccessor, IEnumerable<IHomePageProvider> homePageProviders, ITimetableSlugConstraint TimetableSlugConstraint) { _workContextAccessor = workContextAccessor; _TimetableSlugConstraint = TimetableSlugConstraint; _routableHomePageProvider = homePageProviders.SingleOrDefault(p => p.GetProviderName() == RoutableHomePageProvider.Name); Filters.Add(StorageFilter.For(repository)); Action<PublishContentContext, RoutePart> publishedHandler = (context, route) => { if (route.Is<TimetablePart>()) { if (route.ContentItem.Id != 0 && route.PromoteToHomePage) _TimetableSlugConstraint.AddSlug(""); } else if (route.ContentItem.Id != 0 && route.PromoteToHomePage) { _TimetableSlugConstraint.RemoveSlug(""); } }; OnPublished<RoutePart>(publishedHandler); OnUnpublished<RoutePart>(publishedHandler); OnGetDisplayShape<TimetablePart>((context, Timetable) => { context.Shape.Description = Timetable.Description; context.Shape.AppointmentCount = Timetable.AppointmentCount; }); }
public TimetableSlugConstraintUpdator(ITimetableSlugConstraint TimetableSlugConstraint, ITimetableService TimetableService) { _TimetableSlugConstraint = TimetableSlugConstraint; _TimetableService = TimetableService; }
public TimetableService(IContentManager contentManager, ITimetableSlugConstraint TimetableSlugConstraint) { _contentManager = contentManager; _TimetableSlugConstraint = TimetableSlugConstraint; }
public Routes(ITimetableSlugConstraint TimetableSlugConstraint) { _TimetableSlugConstraint = TimetableSlugConstraint; }