Merge pull request #1678 from marxjohnson/MOBILE-2721_master

MOBILE_2721 course: Use shortname in course title if courselistshortn…
main
Juan Leyva 2018-12-19 11:05:57 +01:00 committed by GitHub
commit 393e7c20da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -43,7 +43,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 '';
}
}
/**