MOBILE_2721 course: Use shortname in course title if courselistshortnames is enabled

main
Mark Johnson 2018-11-09 13:45:02 +00:00
parent e10e0de010
commit 77ab9a85d1
2 changed files with 15 additions and 3 deletions

View File

@ -49,7 +49,7 @@ export class CoreCourseFormatSingleActivityHandler implements CoreCourseFormatHa
}
/**
* Get the title to use in course page. If not defined, course fullname.
* Get the title to use in course page. If not defined, course displayname or fullname.
* This function will be called without sections first, and then call it again when the sections are retrieved.
*
* @param {any} course The course.
@ -61,7 +61,13 @@ export class CoreCourseFormatSingleActivityHandler implements CoreCourseFormatHa
return sections[0].modules[0].name;
}
return course.fullname || '';
if (course.displayname) {
return course.displayname;
} else if (course.fullname) {
return course.fullname;
} else {
return '';
}
}
/**

View File

@ -44,7 +44,13 @@ export class CoreCourseFormatDefaultHandler implements CoreCourseFormatHandler {
* @return {string} Title.
*/
getCourseTitle(course: any): string {
return course.fullname || '';
if (course.displayname) {
return course.displayname;
} else if (course.fullname) {
return course.fullname;
} else {
return '';
}
}
/**