Skip to content

Commit 3c68a04

Browse files
committed
MOBILE-3411 h5pactivity: Support index link handler
1 parent 6621fc5 commit 3c68a04

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

src/addon/mod/h5pactivity/h5pactivity.module.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
// limitations under the License.
1414

1515
import { NgModule } from '@angular/core';
16+
17+
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
18+
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
19+
1620
import { AddonModH5PActivityComponentsModule } from './components/components.module';
1721
import { AddonModH5PActivityModuleHandler } from './providers/module-handler';
1822
import { AddonModH5PActivityProvider } from './providers/h5pactivity';
19-
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
23+
import { AddonModH5PActivityIndexLinkHandler } from './providers/index-link-handler';
2024

2125
// List of providers (without handlers).
2226
export const ADDON_MOD_H5P_ACTIVITY_PROVIDERS: any[] = [
@@ -32,12 +36,16 @@ export const ADDON_MOD_H5P_ACTIVITY_PROVIDERS: any[] = [
3236
providers: [
3337
AddonModH5PActivityProvider,
3438
AddonModH5PActivityModuleHandler,
39+
AddonModH5PActivityIndexLinkHandler,
3540
]
3641
})
3742
export class AddonModH5PActivityModule {
3843
constructor(moduleDelegate: CoreCourseModuleDelegate,
39-
moduleHandler: AddonModH5PActivityModuleHandler) {
44+
moduleHandler: AddonModH5PActivityModuleHandler,
45+
linksDelegate: CoreContentLinksDelegate,
46+
indexHandler: AddonModH5PActivityIndexLinkHandler) {
4047

4148
moduleDelegate.registerHandler(moduleHandler);
49+
linksDelegate.registerHandler(indexHandler);
4250
}
4351
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// (C) Copyright 2015 Moodle Pty Ltd.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import { Injectable } from '@angular/core';
16+
import { CoreContentLinksModuleIndexHandler } from '@core/contentlinks/classes/module-index-handler';
17+
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
18+
19+
/**
20+
* Handler to treat links to H5P activity index.
21+
*/
22+
@Injectable()
23+
export class AddonModH5PActivityIndexLinkHandler extends CoreContentLinksModuleIndexHandler {
24+
name = 'AddonModH5PActivityIndexLinkHandler';
25+
26+
constructor(courseHelper: CoreCourseHelperProvider) {
27+
super(courseHelper, 'AddonModH5PActivity', 'h5pactivity');
28+
}
29+
}

0 commit comments

Comments
 (0)