MOBILE-2491 filter: Prefetch filters

main
Dani Palou 2019-10-08 11:30:20 +02:00
parent b99d31ca61
commit 0d41e7206c
27 changed files with 313 additions and 114 deletions

View File

@ -17,6 +17,7 @@ import { CoreCourseOptionsHandler, CoreCourseOptionsHandlerData } from '@core/co
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { AddonCompetencyCourseComponent } from '../components/course/course'; import { AddonCompetencyCourseComponent } from '../components/course/course';
import { AddonCompetencyProvider } from '../providers/competency'; import { AddonCompetencyProvider } from '../providers/competency';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Course nav handler. * Course nav handler.
@ -26,7 +27,7 @@ export class AddonCompetencyCourseOptionHandler implements CoreCourseOptionsHand
name = 'AddonCompetency'; name = 'AddonCompetency';
priority = 300; priority = 300;
constructor(private competencyProvider: AddonCompetencyProvider) {} constructor(private competencyProvider: AddonCompetencyProvider, protected filterHelper: CoreFilterHelperProvider) {}
/** /**
* Whether or not the handler is enabled ona site level. * Whether or not the handler is enabled ona site level.
@ -110,6 +111,18 @@ export class AddonCompetencyCourseOptionHandler implements CoreCourseOptionsHand
promises.push(this.competencyProvider.getCompetencySummary(competency.competency.id, undefined, undefined, promises.push(this.competencyProvider.getCompetencySummary(competency.competency.id, undefined, undefined,
true)); true));
if (competency.coursemodules) {
competency.coursemodules.forEach((module) => {
promises.push(this.filterHelper.getFilters('module', module.id, {courseId: course.id}));
});
}
if (competency.plans) {
competency.plans.forEach((plan) => {
promises.push(this.filterHelper.getFilters('user', plan.userid));
});
}
}); });
} }

View File

@ -31,6 +31,7 @@ import { AddonModAssignHelperProvider, AddonModAssignSubmissionFormatted } from
import { AddonModAssignSyncProvider } from './assign-sync'; import { AddonModAssignSyncProvider } from './assign-sync';
import { AddonModAssignFeedbackDelegate } from './feedback-delegate'; import { AddonModAssignFeedbackDelegate } from './feedback-delegate';
import { AddonModAssignSubmissionDelegate } from './submission-delegate'; import { AddonModAssignSubmissionDelegate } from './submission-delegate';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch assigns. * Handler to prefetch assigns.
@ -42,16 +43,26 @@ export class AddonModAssignPrefetchHandler extends CoreCourseActivityPrefetchHan
component = AddonModAssignProvider.COMPONENT; component = AddonModAssignProvider.COMPONENT;
updatesNames = /^configuration$|^.*files$|^submissions$|^grades$|^gradeitems$|^outcomes$|^comments$/; updatesNames = /^configuration$|^.*files$|^submissions$|^grades$|^gradeitems$|^outcomes$|^comments$/;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected assignProvider: AddonModAssignProvider, utils: CoreUtilsProvider,
protected textUtils: CoreTextUtilsProvider, protected feedbackDelegate: AddonModAssignFeedbackDelegate, courseProvider: CoreCourseProvider,
protected submissionDelegate: AddonModAssignSubmissionDelegate, protected courseHelper: CoreCourseHelperProvider, filepoolProvider: CoreFilepoolProvider,
protected groupsProvider: CoreGroupsProvider, protected gradesHelper: CoreGradesHelperProvider, sitesProvider: CoreSitesProvider,
protected userProvider: CoreUserProvider, protected assignHelper: AddonModAssignHelperProvider, domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected assignProvider: AddonModAssignProvider,
protected textUtils: CoreTextUtilsProvider,
protected feedbackDelegate: AddonModAssignFeedbackDelegate,
protected submissionDelegate: AddonModAssignSubmissionDelegate,
protected courseHelper: CoreCourseHelperProvider,
protected groupsProvider: CoreGroupsProvider,
protected gradesHelper: CoreGradesHelperProvider,
protected userProvider: CoreUserProvider,
protected assignHelper: AddonModAssignHelperProvider,
protected syncProvider: AddonModAssignSyncProvider) { protected syncProvider: AddonModAssignSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -22,6 +22,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler'; import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
import { AddonModBookProvider } from './book'; import { AddonModBookProvider } from './book';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch books. * Handler to prefetch books.
@ -33,11 +34,17 @@ export class AddonModBookPrefetchHandler extends CoreCourseResourcePrefetchHandl
component = AddonModBookProvider.COMPONENT; component = AddonModBookProvider.COMPONENT;
updatesNames = /^configuration$|^.*files$|^entries$/; updatesNames = /^configuration$|^.*files$|^entries$/;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected bookProvider: AddonModBookProvider) { utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected bookProvider: AddonModBookProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -24,6 +24,7 @@ import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler'; import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { CoreUserProvider } from '@core/user/providers/user'; import { CoreUserProvider } from '@core/user/providers/user';
import { AddonModChatProvider, AddonModChatChat } from './chat'; import { AddonModChatProvider, AddonModChatChat } from './chat';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch chats. * Handler to prefetch chats.
@ -41,11 +42,12 @@ export class AddonModChatPrefetchHandler extends CoreCourseActivityPrefetchHandl
filepoolProvider: CoreFilepoolProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider, sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider, domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
private groupsProvider: CoreGroupsProvider, private groupsProvider: CoreGroupsProvider,
private userProvider: CoreUserProvider, private userProvider: CoreUserProvider,
private chatProvider: AddonModChatProvider) { private chatProvider: AddonModChatProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -24,6 +24,7 @@ import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/acti
import { CoreUserProvider } from '@core/user/providers/user'; import { CoreUserProvider } from '@core/user/providers/user';
import { AddonModChoiceSyncProvider } from './sync'; import { AddonModChoiceSyncProvider } from './sync';
import { AddonModChoiceProvider } from './choice'; import { AddonModChoiceProvider } from './choice';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch choices. * Handler to prefetch choices.
@ -37,12 +38,19 @@ export class AddonModChoicePrefetchHandler extends CoreCourseActivityPrefetchHan
protected syncProvider: AddonModChoiceSyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModChoiceSyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected choiceProvider: AddonModChoiceProvider, utils: CoreUtilsProvider,
protected userProvider: CoreUserProvider, protected injector: Injector) { courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected choiceProvider: AddonModChoiceProvider,
protected userProvider: CoreUserProvider,
protected injector: Injector) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -27,6 +27,7 @@ import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/acti
import { AddonModDataProvider, AddonModDataEntry } from './data'; import { AddonModDataProvider, AddonModDataEntry } from './data';
import { AddonModDataSyncProvider } from './sync'; import { AddonModDataSyncProvider } from './sync';
import { AddonModDataHelperProvider } from './helper'; import { AddonModDataHelperProvider } from './helper';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch databases. * Handler to prefetch databases.
@ -38,14 +39,22 @@ export class AddonModDataPrefetchHandler extends CoreCourseActivityPrefetchHandl
component = AddonModDataProvider.COMPONENT; component = AddonModDataProvider.COMPONENT;
updatesNames = /^configuration$|^.*files$|^entries$|^gradeitems$|^outcomes$|^comments$|^ratings/; updatesNames = /^configuration$|^.*files$|^entries$|^gradeitems$|^outcomes$|^comments$|^ratings/;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected dataProvider: AddonModDataProvider, utils: CoreUtilsProvider,
protected timeUtils: CoreTimeUtilsProvider, protected dataHelper: AddonModDataHelperProvider, courseProvider: CoreCourseProvider,
protected groupsProvider: CoreGroupsProvider, protected commentsProvider: CoreCommentsProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected dataProvider: AddonModDataProvider,
protected timeUtils: CoreTimeUtilsProvider,
protected dataHelper: AddonModDataHelperProvider,
protected groupsProvider: CoreGroupsProvider,
protected commentsProvider: CoreCommentsProvider,
protected syncProvider: AddonModDataSyncProvider) { protected syncProvider: AddonModDataSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -26,6 +26,7 @@ import { AddonModFeedbackHelperProvider } from './helper';
import { CoreTimeUtilsProvider } from '@providers/utils/time'; import { CoreTimeUtilsProvider } from '@providers/utils/time';
import { CoreGroupsProvider } from '@providers/groups'; import { CoreGroupsProvider } from '@providers/groups';
import { AddonModFeedbackSyncProvider } from './sync'; import { AddonModFeedbackSyncProvider } from './sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch feedbacks. * Handler to prefetch feedbacks.
@ -39,14 +40,21 @@ export class AddonModFeedbackPrefetchHandler extends CoreCourseActivityPrefetchH
protected syncProvider: AddonModFeedbackSyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModFeedbackSyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected feedbackProvider: AddonModFeedbackProvider, utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected feedbackProvider: AddonModFeedbackProvider,
protected feedbackHelper: AddonModFeedbackHelperProvider, protected feedbackHelper: AddonModFeedbackHelperProvider,
protected timeUtils: CoreTimeUtilsProvider, protected groupsProvider: CoreGroupsProvider, protected timeUtils: CoreTimeUtilsProvider,
protected groupsProvider: CoreGroupsProvider,
protected injector: Injector) { protected injector: Injector) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -22,6 +22,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler'; import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
import { AddonModFolderProvider } from './folder'; import { AddonModFolderProvider } from './folder';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch folders. * Handler to prefetch folders.
@ -32,11 +33,17 @@ export class AddonModFolderPrefetchHandler extends CoreCourseResourcePrefetchHan
modName = 'folder'; modName = 'folder';
component = AddonModFolderProvider.COMPONENT; component = AddonModFolderProvider.COMPONENT;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected folderProvider: AddonModFolderProvider) { utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected folderProvider: AddonModFolderProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -25,6 +25,7 @@ import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/acti
import { CoreGroupsProvider } from '@providers/groups'; import { CoreGroupsProvider } from '@providers/groups';
import { AddonModForumProvider } from './forum'; import { AddonModForumProvider } from './forum';
import { AddonModForumSyncProvider } from './sync'; import { AddonModForumSyncProvider } from './sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch forums. * Handler to prefetch forums.
@ -43,12 +44,13 @@ export class AddonModForumPrefetchHandler extends CoreCourseActivityPrefetchHand
filepoolProvider: CoreFilepoolProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider, sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider, domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
private userProvider: CoreUserProvider, private userProvider: CoreUserProvider,
private groupsProvider: CoreGroupsProvider, private groupsProvider: CoreGroupsProvider,
private forumProvider: AddonModForumProvider, private forumProvider: AddonModForumProvider,
private syncProvider: AddonModForumSyncProvider) { private syncProvider: AddonModForumSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -23,6 +23,7 @@ import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler'; import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { AddonModGlossaryProvider } from './glossary'; import { AddonModGlossaryProvider } from './glossary';
import { AddonModGlossarySyncProvider } from './sync'; import { AddonModGlossarySyncProvider } from './sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch forums. * Handler to prefetch forums.
@ -41,10 +42,11 @@ export class AddonModGlossaryPrefetchHandler extends CoreCourseActivityPrefetchH
filepoolProvider: CoreFilepoolProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider, sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider, domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
private glossaryProvider: AddonModGlossaryProvider, private glossaryProvider: AddonModGlossaryProvider,
private syncProvider: AddonModGlossarySyncProvider) { private syncProvider: AddonModGlossarySyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -22,6 +22,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler'; import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
import { AddonModImscpProvider } from './imscp'; import { AddonModImscpProvider } from './imscp';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch IMSCPs. * Handler to prefetch IMSCPs.
@ -32,11 +33,17 @@ export class AddonModImscpPrefetchHandler extends CoreCourseResourcePrefetchHand
modName = 'imscp'; modName = 'imscp';
component = AddonModImscpProvider.COMPONENT; component = AddonModImscpProvider.COMPONENT;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected imscpProvider: AddonModImscpProvider) { utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected imscpProvider: AddonModImscpProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -22,6 +22,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler'; import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
import { AddonModLabelProvider } from './label'; import { AddonModLabelProvider } from './label';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch labels. * Handler to prefetch labels.
@ -34,11 +35,17 @@ export class AddonModLabelPrefetchHandler extends CoreCourseResourcePrefetchHand
updatesNames = /^.*files$/; updatesNames = /^.*files$/;
skipListStatus = true; skipListStatus = true;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected labelProvider: AddonModLabelProvider) { utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected labelProvider: AddonModLabelProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -25,6 +25,7 @@ import { CoreGroupsProvider } from '@providers/groups';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler'; import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { AddonModLessonProvider } from './lesson'; import { AddonModLessonProvider } from './lesson';
import { AddonModLessonSyncProvider } from './lesson-sync'; import { AddonModLessonSyncProvider } from './lesson-sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch lessons. * Handler to prefetch lessons.
@ -39,12 +40,20 @@ export class AddonModLessonPrefetchHandler extends CoreCourseActivityPrefetchHan
protected syncProvider: AddonModLessonSyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModLessonSyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected modalCtrl: ModalController, protected groupsProvider: CoreGroupsProvider, utils: CoreUtilsProvider,
protected lessonProvider: AddonModLessonProvider, protected injector: Injector) { courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected modalCtrl: ModalController,
protected groupsProvider: CoreGroupsProvider,
protected lessonProvider: AddonModLessonProvider,
protected injector: Injector) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -23,6 +23,7 @@ import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler'; import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/resource-prefetch-handler';
import { AddonModPageProvider } from './page'; import { AddonModPageProvider } from './page';
import { AddonModPageHelperProvider } from './helper'; import { AddonModPageHelperProvider } from './helper';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch pages. * Handler to prefetch pages.
@ -34,12 +35,18 @@ export class AddonModPagePrefetchHandler extends CoreCourseResourcePrefetchHandl
component = AddonModPageProvider.COMPONENT; component = AddonModPageProvider.COMPONENT;
updatesNames = /^configuration$|^.*files$/; updatesNames = /^configuration$|^.*files$/;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected pageProvider: AddonModPageProvider, utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected pageProvider: AddonModPageProvider,
protected pageHelper: AddonModPageHelperProvider) { protected pageHelper: AddonModPageHelperProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -28,6 +28,7 @@ import { AddonModQuizHelperProvider } from './helper';
import { AddonModQuizAccessRuleDelegate } from './access-rules-delegate'; import { AddonModQuizAccessRuleDelegate } from './access-rules-delegate';
import { AddonModQuizSyncProvider } from './quiz-sync'; import { AddonModQuizSyncProvider } from './quiz-sync';
import { CoreConstants } from '@core/constants'; import { CoreConstants } from '@core/constants';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch quizzes. * Handler to prefetch quizzes.
@ -41,13 +42,22 @@ export class AddonModQuizPrefetchHandler extends CoreCourseActivityPrefetchHandl
protected syncProvider: AddonModQuizSyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModQuizSyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected injector: Injector, protected quizProvider: AddonModQuizProvider, utils: CoreUtilsProvider,
protected textUtils: CoreTextUtilsProvider, protected quizHelper: AddonModQuizHelperProvider, courseProvider: CoreCourseProvider,
protected accessRuleDelegate: AddonModQuizAccessRuleDelegate, protected questionHelper: CoreQuestionHelperProvider) { filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected injector: Injector,
protected quizProvider: AddonModQuizProvider,
protected textUtils: CoreTextUtilsProvider,
protected quizHelper: AddonModQuizHelperProvider,
protected accessRuleDelegate: AddonModQuizAccessRuleDelegate,
protected questionHelper: CoreQuestionHelperProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -24,6 +24,7 @@ import { CoreCourseResourcePrefetchHandlerBase } from '@core/course/classes/reso
import { AddonModResourceProvider } from './resource'; import { AddonModResourceProvider } from './resource';
import { AddonModResourceHelperProvider } from './helper'; import { AddonModResourceHelperProvider } from './helper';
import { CoreConstants } from '@core/constants'; import { CoreConstants } from '@core/constants';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch resources. * Handler to prefetch resources.
@ -34,12 +35,18 @@ export class AddonModResourcePrefetchHandler extends CoreCourseResourcePrefetchH
modName = 'resource'; modName = 'resource';
component = AddonModResourceProvider.COMPONENT; component = AddonModResourceProvider.COMPONENT;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected resourceProvider: AddonModResourceProvider, utils: CoreUtilsProvider,
courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected resourceProvider: AddonModResourceProvider,
protected resourceHelper: AddonModResourceHelperProvider) { protected resourceHelper: AddonModResourceHelperProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -25,6 +25,7 @@ import { CoreTextUtilsProvider } from '@providers/utils/text';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler'; import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { AddonModScormProvider } from './scorm'; import { AddonModScormProvider } from './scorm';
import { AddonModScormSyncProvider } from './scorm-sync'; import { AddonModScormSyncProvider } from './scorm-sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Progress event used when downloading a SCORM. * Progress event used when downloading a SCORM.
@ -58,12 +59,20 @@ export class AddonModScormPrefetchHandler extends CoreCourseActivityPrefetchHand
protected syncProvider: AddonModScormSyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModScormSyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected fileProvider: CoreFileProvider, protected textUtils: CoreTextUtilsProvider, utils: CoreUtilsProvider,
protected scormProvider: AddonModScormProvider, protected injector: Injector) { courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected fileProvider: CoreFileProvider,
protected textUtils: CoreTextUtilsProvider,
protected scormProvider: AddonModScormProvider,
protected injector: Injector) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -24,6 +24,7 @@ import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/acti
import { AddonModSurveyProvider } from './survey'; import { AddonModSurveyProvider } from './survey';
import { AddonModSurveySyncProvider } from './sync'; import { AddonModSurveySyncProvider } from './sync';
import { AddonModSurveyHelperProvider } from './helper'; import { AddonModSurveyHelperProvider } from './helper';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch surveys. * Handler to prefetch surveys.
@ -37,12 +38,19 @@ export class AddonModSurveyPrefetchHandler extends CoreCourseActivityPrefetchHan
protected syncProvider: AddonModSurveySyncProvider; // It will be injected later to prevent circular dependencies. protected syncProvider: AddonModSurveySyncProvider; // It will be injected later to prevent circular dependencies.
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected surveyProvider: AddonModSurveyProvider, utils: CoreUtilsProvider,
protected surveyHelper: AddonModSurveyHelperProvider, protected injector: Injector) { courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected surveyProvider: AddonModSurveyProvider,
protected surveyHelper: AddonModSurveyHelperProvider,
protected injector: Injector) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -28,6 +28,7 @@ import { CoreGradesHelperProvider } from '@core/grades/providers/helper';
import { CoreUserProvider } from '@core/user/providers/user'; import { CoreUserProvider } from '@core/user/providers/user';
import { AddonModWikiProvider } from './wiki'; import { AddonModWikiProvider } from './wiki';
import { AddonModWikiSyncProvider } from './wiki-sync'; import { AddonModWikiSyncProvider } from './wiki-sync';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch wikis. * Handler to prefetch wikis.
@ -39,14 +40,23 @@ export class AddonModWikiPrefetchHandler extends CoreCourseActivityPrefetchHandl
component = AddonModWikiProvider.COMPONENT; component = AddonModWikiProvider.COMPONENT;
updatesNames = /^.*files$|^pages$/; updatesNames = /^.*files$|^pages$/;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected wikiProvider: AddonModWikiProvider, protected userProvider: CoreUserProvider, utils: CoreUtilsProvider,
protected textUtils: CoreTextUtilsProvider, protected courseHelper: CoreCourseHelperProvider, courseProvider: CoreCourseProvider,
protected groupsProvider: CoreGroupsProvider, protected gradesHelper: CoreGradesHelperProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected wikiProvider: AddonModWikiProvider,
protected userProvider: CoreUserProvider,
protected textUtils: CoreTextUtilsProvider,
protected courseHelper: CoreCourseHelperProvider,
protected groupsProvider: CoreGroupsProvider,
protected gradesHelper: CoreGradesHelperProvider,
protected syncProvider: AddonModWikiSyncProvider) { protected syncProvider: AddonModWikiSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -26,6 +26,7 @@ import { CoreUserProvider } from '@core/user/providers/user';
import { AddonModWorkshopProvider } from './workshop'; import { AddonModWorkshopProvider } from './workshop';
import { AddonModWorkshopSyncProvider } from './sync'; import { AddonModWorkshopSyncProvider } from './sync';
import { AddonModWorkshopHelperProvider } from './helper'; import { AddonModWorkshopHelperProvider } from './helper';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch workshops. * Handler to prefetch workshops.
@ -45,13 +46,14 @@ export class AddonModWorkshopPrefetchHandler extends CoreCourseActivityPrefetchH
filepoolProvider: CoreFilepoolProvider, filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider, sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider, domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
private groupsProvider: CoreGroupsProvider, private groupsProvider: CoreGroupsProvider,
private userProvider: CoreUserProvider, private userProvider: CoreUserProvider,
private workshopProvider: AddonModWorkshopProvider, private workshopProvider: AddonModWorkshopProvider,
private workshopHelper: AddonModWorkshopHelperProvider, private workshopHelper: AddonModWorkshopHelperProvider,
private syncProvider: AddonModWorkshopSyncProvider) { private syncProvider: AddonModWorkshopSyncProvider) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
} }
/** /**

View File

@ -101,10 +101,11 @@ export class CoreCourseActivityPrefetchHandlerBase extends CoreCourseModulePrefe
} }
const prefetchPromise = this.setDownloading(module.id, siteId).then(() => { const prefetchPromise = this.setDownloading(module.id, siteId).then(() => {
// Package marked as downloading, get module info to be able to handle links. // Package marked as downloading, get module info to be able to handle links. Get module filters too.
return Promise.all([ return Promise.all([
this.courseProvider.getModuleBasicInfo(module.id, siteId), this.courseProvider.getModuleBasicInfo(module.id, siteId),
this.courseProvider.getModule(module.id, courseId, undefined, false, true, siteId), this.courseProvider.getModule(module.id, courseId, undefined, false, true, siteId),
this.filterHelper.getFilters('module', module.id, {courseId: courseId})
]); ]);
}).then(() => { }).then(() => {
// Call the download function, send all the params except downloadFn. This includes all params passed after siteId. // Call the download function, send all the params except downloadFn. This includes all params passed after siteId.

View File

@ -20,6 +20,7 @@ import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreUtilsProvider } from '@providers/utils/utils'; import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '../providers/course'; import { CoreCourseProvider } from '../providers/course';
import { CoreCourseModulePrefetchHandler } from '../providers/module-prefetch-delegate'; import { CoreCourseModulePrefetchHandler } from '../providers/module-prefetch-delegate';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Base prefetch handler to be registered in CoreCourseModulePrefetchDelegate. Prefetch handlers should inherit either * Base prefetch handler to be registered in CoreCourseModulePrefetchDelegate. Prefetch handlers should inherit either
@ -59,9 +60,14 @@ export class CoreCourseModulePrefetchHandlerBase implements CoreCourseModulePref
*/ */
protected downloadPromises: { [s: string]: { [s: string]: Promise<any> } } = {}; protected downloadPromises: { [s: string]: { [s: string]: Promise<any> } } = {};
constructor(protected translate: TranslateService, protected appProvider: CoreAppProvider, protected utils: CoreUtilsProvider, constructor(protected translate: TranslateService,
protected courseProvider: CoreCourseProvider, protected filepoolProvider: CoreFilepoolProvider, protected appProvider: CoreAppProvider,
protected sitesProvider: CoreSitesProvider, protected domUtils: CoreDomUtilsProvider) { } protected utils: CoreUtilsProvider,
protected courseProvider: CoreCourseProvider,
protected filepoolProvider: CoreFilepoolProvider,
protected sitesProvider: CoreSitesProvider,
protected domUtils: CoreDomUtilsProvider,
protected filterHelper: CoreFilterHelperProvider) { }
/** /**
* Add an ongoing download to the downloadPromises list. When the promise finishes it will be removed. * Add an ongoing download to the downloadPromises list. When the promise finishes it will be removed.

View File

@ -87,6 +87,8 @@ export class CoreCourseResourcePrefetchHandlerBase extends CoreCourseModulePrefe
promises.push(downloadFn(siteId, files, this.component, module.id)); promises.push(downloadFn(siteId, files, this.component, module.id));
} }
promises.push(this.filterHelper.getFilters('module', module.id, {courseId: courseId}));
return Promise.all(promises); return Promise.all(promises);
}); });

View File

@ -38,6 +38,7 @@ import { CoreConstants } from '@core/constants';
import { CoreSite } from '@classes/site'; import { CoreSite } from '@classes/site';
import { CoreLoggerProvider } from '@providers/logger'; import { CoreLoggerProvider } from '@providers/logger';
import * as moment from 'moment'; import * as moment from 'moment';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Prefetch info of a module. * Prefetch info of a module.
@ -108,16 +109,28 @@ export class CoreCourseHelperProvider {
protected courseDwnPromises: { [s: string]: { [id: number]: Promise<any> } } = {}; protected courseDwnPromises: { [s: string]: { [id: number]: Promise<any> } } = {};
protected logger; protected logger;
constructor(private courseProvider: CoreCourseProvider, private domUtils: CoreDomUtilsProvider, constructor(private courseProvider: CoreCourseProvider,
private moduleDelegate: CoreCourseModuleDelegate, private prefetchDelegate: CoreCourseModulePrefetchDelegate, private domUtils: CoreDomUtilsProvider,
private filepoolProvider: CoreFilepoolProvider, private sitesProvider: CoreSitesProvider, private moduleDelegate: CoreCourseModuleDelegate,
private textUtils: CoreTextUtilsProvider, private timeUtils: CoreTimeUtilsProvider, private prefetchDelegate: CoreCourseModulePrefetchDelegate,
private utils: CoreUtilsProvider, private translate: TranslateService, private loginHelper: CoreLoginHelperProvider, private filepoolProvider: CoreFilepoolProvider,
private courseOptionsDelegate: CoreCourseOptionsDelegate, private siteHomeProvider: CoreSiteHomeProvider, private sitesProvider: CoreSitesProvider,
private eventsProvider: CoreEventsProvider, private fileHelper: CoreFileHelperProvider, private textUtils: CoreTextUtilsProvider,
private appProvider: CoreAppProvider, private fileProvider: CoreFileProvider, private injector: Injector, private timeUtils: CoreTimeUtilsProvider,
private coursesProvider: CoreCoursesProvider, private courseOffline: CoreCourseOfflineProvider, private utils: CoreUtilsProvider,
loggerProvider: CoreLoggerProvider) { private translate: TranslateService,
private loginHelper: CoreLoginHelperProvider,
private courseOptionsDelegate: CoreCourseOptionsDelegate,
private siteHomeProvider: CoreSiteHomeProvider,
private eventsProvider: CoreEventsProvider,
private fileHelper: CoreFileHelperProvider,
private appProvider: CoreAppProvider,
private fileProvider: CoreFileProvider,
private injector: Injector,
private coursesProvider: CoreCoursesProvider,
private courseOffline: CoreCourseOfflineProvider,
loggerProvider: CoreLoggerProvider,
private filterHelper: CoreFilterHelperProvider) {
this.logger = loggerProvider.getInstance('CoreCourseHelperProvider'); this.logger = loggerProvider.getInstance('CoreCourseHelperProvider');
} }
@ -1270,6 +1283,8 @@ export class CoreCourseHelperProvider {
promises.push(this.courseProvider.getActivitiesCompletionStatus(course.id)); promises.push(this.courseProvider.getActivitiesCompletionStatus(course.id));
} }
promises.push(this.filterHelper.getFilters('course', course.id));
return this.utils.allPromises(promises); return this.utils.allPromises(promises);
}).then(() => { }).then(() => {
// Download success, mark the course as downloaded. // Download success, mark the course as downloaded.

View File

@ -105,6 +105,7 @@ export class CoreFilterHelperProvider {
getFilters(contextLevel: string, instanceId: number, options?: CoreFilterFormatTextOptions, siteId?: string) getFilters(contextLevel: string, instanceId: number, options?: CoreFilterFormatTextOptions, siteId?: string)
: Promise<CoreFilterFilter[]> { : Promise<CoreFilterFilter[]> {
options = options || {};
options.contextLevel = contextLevel; options.contextLevel = contextLevel;
options.instanceId = instanceId; options.instanceId = instanceId;
options.filter = false; options.filter = false;

View File

@ -21,6 +21,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreSitePluginsProvider } from '../../providers/siteplugins'; import { CoreSitePluginsProvider } from '../../providers/siteplugins';
import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler'; import { CoreCourseActivityPrefetchHandlerBase } from '@core/course/classes/activity-prefetch-handler';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
/** /**
* Handler to prefetch a module site plugin. * Handler to prefetch a module site plugin.
@ -30,12 +31,21 @@ export class CoreSitePluginsModulePrefetchHandler extends CoreCourseActivityPref
protected isResource: boolean; protected isResource: boolean;
constructor(translate: TranslateService, appProvider: CoreAppProvider, utils: CoreUtilsProvider, constructor(translate: TranslateService,
courseProvider: CoreCourseProvider, filepoolProvider: CoreFilepoolProvider, sitesProvider: CoreSitesProvider, appProvider: CoreAppProvider,
domUtils: CoreDomUtilsProvider, protected sitePluginsProvider: CoreSitePluginsProvider, component: string, utils: CoreUtilsProvider,
name: string, modName: string, protected handlerSchema: any) { courseProvider: CoreCourseProvider,
filepoolProvider: CoreFilepoolProvider,
sitesProvider: CoreSitesProvider,
domUtils: CoreDomUtilsProvider,
filterHelper: CoreFilterHelperProvider,
protected sitePluginsProvider: CoreSitePluginsProvider,
component: string,
name: string,
modName: string,
protected handlerSchema: any) {
super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils); super(translate, appProvider, utils, courseProvider, filepoolProvider, sitesProvider, domUtils, filterHelper);
this.component = component; this.component = component;
this.name = name; this.name = name;

View File

@ -31,6 +31,7 @@ import { CoreCompileProvider } from '@core/compile/providers/compile';
import { CoreQuestionProvider } from '@core/question/providers/question'; import { CoreQuestionProvider } from '@core/question/providers/question';
import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreCoursesProvider } from '@core/courses/providers/courses'; import { CoreCoursesProvider } from '@core/courses/providers/courses';
import { CoreFilterHelperProvider } from '@core/filter/providers/helper';
// Delegates // Delegates
import { CoreMainMenuDelegate } from '@core/mainmenu/providers/delegate'; import { CoreMainMenuDelegate } from '@core/mainmenu/providers/delegate';
@ -84,21 +85,39 @@ export class CoreSitePluginsHelperProvider {
protected logger; protected logger;
protected courseRestrictHandlers = {}; protected courseRestrictHandlers = {};
constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private domUtils: CoreDomUtilsProvider, constructor(logger: CoreLoggerProvider,
private mainMenuDelegate: CoreMainMenuDelegate, private moduleDelegate: CoreCourseModuleDelegate, private sitesProvider: CoreSitesProvider,
private userDelegate: CoreUserDelegate, private langProvider: CoreLangProvider, private http: Http, private domUtils: CoreDomUtilsProvider,
private sitePluginsProvider: CoreSitePluginsProvider, private prefetchDelegate: CoreCourseModulePrefetchDelegate, private mainMenuDelegate: CoreMainMenuDelegate,
private compileProvider: CoreCompileProvider, private utils: CoreUtilsProvider, private urlUtils: CoreUrlUtilsProvider, private moduleDelegate: CoreCourseModuleDelegate,
private courseOptionsDelegate: CoreCourseOptionsDelegate, private eventsProvider: CoreEventsProvider, private userDelegate: CoreUserDelegate,
private courseFormatDelegate: CoreCourseFormatDelegate, private profileFieldDelegate: CoreUserProfileFieldDelegate, private langProvider: CoreLangProvider,
private textUtils: CoreTextUtilsProvider, private filepoolProvider: CoreFilepoolProvider, private http: Http,
private settingsDelegate: CoreSettingsDelegate, private questionDelegate: CoreQuestionDelegate, private sitePluginsProvider: CoreSitePluginsProvider,
private questionBehaviourDelegate: CoreQuestionBehaviourDelegate, private questionProvider: CoreQuestionProvider, private prefetchDelegate: CoreCourseModulePrefetchDelegate,
private messageOutputDelegate: AddonMessageOutputDelegate, private accessRulesDelegate: AddonModQuizAccessRuleDelegate, private compileProvider: CoreCompileProvider,
private assignSubmissionDelegate: AddonModAssignSubmissionDelegate, private translate: TranslateService, private utils: CoreUtilsProvider,
private assignFeedbackDelegate: AddonModAssignFeedbackDelegate, private appProvider: CoreAppProvider, private urlUtils: CoreUrlUtilsProvider,
private courseOptionsDelegate: CoreCourseOptionsDelegate,
private eventsProvider: CoreEventsProvider,
private courseFormatDelegate: CoreCourseFormatDelegate,
private profileFieldDelegate: CoreUserProfileFieldDelegate,
private textUtils: CoreTextUtilsProvider,
private filepoolProvider: CoreFilepoolProvider,
private settingsDelegate: CoreSettingsDelegate,
private questionDelegate: CoreQuestionDelegate,
private questionBehaviourDelegate: CoreQuestionBehaviourDelegate,
private questionProvider: CoreQuestionProvider,
private messageOutputDelegate: AddonMessageOutputDelegate,
private accessRulesDelegate: AddonModQuizAccessRuleDelegate,
private assignSubmissionDelegate: AddonModAssignSubmissionDelegate,
private translate: TranslateService,
private assignFeedbackDelegate: AddonModAssignFeedbackDelegate,
private appProvider: CoreAppProvider,
private workshopAssessmentStrategyDelegate: AddonWorkshopAssessmentStrategyDelegate, private workshopAssessmentStrategyDelegate: AddonWorkshopAssessmentStrategyDelegate,
private courseProvider: CoreCourseProvider, private blockDelegate: CoreBlockDelegate) { private courseProvider: CoreCourseProvider,
private blockDelegate: CoreBlockDelegate,
private filterHelper: CoreFilterHelperProvider) {
this.logger = logger.getInstance('CoreSitePluginsHelperProvider'); this.logger = logger.getInstance('CoreSitePluginsHelperProvider');
@ -820,7 +839,7 @@ export class CoreSitePluginsHelperProvider {
if (handlerSchema.offlinefunctions && Object.keys(handlerSchema.offlinefunctions).length) { if (handlerSchema.offlinefunctions && Object.keys(handlerSchema.offlinefunctions).length) {
// Register the prefetch handler. // Register the prefetch handler.
this.prefetchDelegate.registerHandler(new CoreSitePluginsModulePrefetchHandler(this.translate, this.appProvider, this.prefetchDelegate.registerHandler(new CoreSitePluginsModulePrefetchHandler(this.translate, this.appProvider,
this.utils, this.courseProvider, this.filepoolProvider, this.sitesProvider, this.domUtils, this.utils, this.courseProvider, this.filepoolProvider, this.sitesProvider, this.domUtils, this.filterHelper,
this.sitePluginsProvider, plugin.component, uniqueName, modName, handlerSchema)); this.sitePluginsProvider, plugin.component, uniqueName, modName, handlerSchema));
} }