MDL-12703 - Use the 'welcometocourse' language string if there is no 'welcomemessage' property set in the course object. Currently, there does not seem to be any code or data items that would set this property.

This commit is contained in:
mchurch 2007-12-28 17:14:01 +00:00
parent ca29e37d24
commit 19c8cf7917

View file

@ -4283,12 +4283,17 @@ function email_welcome_message_to_user($course, $user=NULL) {
} }
if (!empty($course->welcomemessage)) { if (!empty($course->welcomemessage)) {
$subject = get_string('welcometocourse', '', format_string($course->fullname)); $message = $course->welcomemessage;
} else {
$a = new Object();
$a->coursename = $course->fullname; $a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id"; $a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
//$message = get_string("welcometocoursetext", "", $a); $message = get_string("welcometocoursetext", "", $a);
$message = $course->welcomemessage; }
/// If you don't want a welcome message sent, then make the message string blank.
if (!empty($message)) {
$subject = get_string('welcometocourse', '', format_string($course->fullname));
if (! $teacher = get_teacher($course->id)) { if (! $teacher = get_teacher($course->id)) {
$teacher = get_admin(); $teacher = get_admin();