MOBILE_2721 course: Use shortname in course title if courselistshortnames is enabled
parent
e10e0de010
commit
77ab9a85d1
|
@ -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.
|
* This function will be called without sections first, and then call it again when the sections are retrieved.
|
||||||
*
|
*
|
||||||
* @param {any} course The course.
|
* @param {any} course The course.
|
||||||
|
@ -61,7 +61,13 @@ export class CoreCourseFormatSingleActivityHandler implements CoreCourseFormatHa
|
||||||
return sections[0].modules[0].name;
|
return sections[0].modules[0].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return course.fullname || '';
|
if (course.displayname) {
|
||||||
|
return course.displayname;
|
||||||
|
} else if (course.fullname) {
|
||||||
|
return course.fullname;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -44,7 +44,13 @@ export class CoreCourseFormatDefaultHandler implements CoreCourseFormatHandler {
|
||||||
* @return {string} Title.
|
* @return {string} Title.
|
||||||
*/
|
*/
|
||||||
getCourseTitle(course: any): string {
|
getCourseTitle(course: any): string {
|
||||||
return course.fullname || '';
|
if (course.displayname) {
|
||||||
|
return course.displayname;
|
||||||
|
} else if (course.fullname) {
|
||||||
|
return course.fullname;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue