MOBILE-3833 siteplugins: Use new icon function
parent
72c516b88c
commit
6af2141284
|
@ -63,18 +63,18 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
getData(
|
||||
async getData(
|
||||
module: CoreCourseModuleData,
|
||||
courseId: number,
|
||||
sectionId?: number,
|
||||
forCoursePage?: boolean,
|
||||
): CoreCourseModuleHandlerData {
|
||||
): Promise<CoreCourseModuleHandlerData> {
|
||||
if (this.shouldOnlyDisplayDescription(module, forCoursePage)) {
|
||||
const title = module.description;
|
||||
module.description = '';
|
||||
|
||||
return {
|
||||
icon: this.getIconSrc(),
|
||||
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
|
||||
title: title || '',
|
||||
a11yTitle: '',
|
||||
class: this.handlerSchema.displaydata?.class,
|
||||
|
@ -85,7 +85,7 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
|
|||
const showDowloadButton = this.handlerSchema.downloadbutton;
|
||||
const handlerData: CoreCourseModuleHandlerData = {
|
||||
title: module.name,
|
||||
icon: this.getIconSrc(),
|
||||
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
|
||||
class: this.handlerSchema.displaydata?.class,
|
||||
showDownloadButton: showDowloadButton !== undefined ? showDowloadButton : hasOffline,
|
||||
};
|
||||
|
@ -198,13 +198,6 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
getIconSrc(): string | undefined {
|
||||
return this.handlerSchema.displaydata?.icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue