Esempio n. 1
0
 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;
 }
Esempio n. 2
0
        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;
 }
Esempio n. 4
0
 public TimetableService(IContentManager contentManager, ITimetableSlugConstraint TimetableSlugConstraint) {
     _contentManager = contentManager;
     _TimetableSlugConstraint = TimetableSlugConstraint;
 }
Esempio n. 5
0
 public Routes(ITimetableSlugConstraint TimetableSlugConstraint)
 {
     _TimetableSlugConstraint = TimetableSlugConstraint;
 }