MOBILE-3833 siteplugins: Use theme icon if present for modules
parent
63bc43ceb4
commit
5445d24a57
|
@ -69,12 +69,14 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
|
||||||
sectionId?: number,
|
sectionId?: number,
|
||||||
forCoursePage?: boolean,
|
forCoursePage?: boolean,
|
||||||
): Promise<CoreCourseModuleHandlerData> {
|
): Promise<CoreCourseModuleHandlerData> {
|
||||||
|
const icon = module.modicon || this.handlerSchema.displaydata?.icon; // Prioritize theme icon over handler icon.
|
||||||
|
|
||||||
if (this.shouldOnlyDisplayDescription(module, forCoursePage)) {
|
if (this.shouldOnlyDisplayDescription(module, forCoursePage)) {
|
||||||
const title = module.description;
|
const title = module.description;
|
||||||
module.description = '';
|
module.description = '';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
|
icon: await CoreCourse.getModuleIconSrc(module.modname, icon),
|
||||||
title: title || '',
|
title: title || '',
|
||||||
a11yTitle: '',
|
a11yTitle: '',
|
||||||
class: this.handlerSchema.displaydata?.class,
|
class: this.handlerSchema.displaydata?.class,
|
||||||
|
@ -85,7 +87,7 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
|
||||||
const showDowloadButton = this.handlerSchema.downloadbutton;
|
const showDowloadButton = this.handlerSchema.downloadbutton;
|
||||||
const handlerData: CoreCourseModuleHandlerData = {
|
const handlerData: CoreCourseModuleHandlerData = {
|
||||||
title: module.name,
|
title: module.name,
|
||||||
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
|
icon: await CoreCourse.getModuleIconSrc(module.modname, icon),
|
||||||
class: this.handlerSchema.displaydata?.class,
|
class: this.handlerSchema.displaydata?.class,
|
||||||
showDownloadButton: showDowloadButton !== undefined ? showDowloadButton : hasOffline,
|
showDownloadButton: showDowloadButton !== undefined ? showDowloadButton : hasOffline,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue