Merge branch 'MDL-72658-master-welcometosite' of git://github.com/mudrd8mz/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2021-09-27 23:33:47 +02:00
2 changed files with 13 additions and 3 deletions
+2 -2
View File
@@ -2266,8 +2266,8 @@ $string['weeks'] = 'weeks';
$string['weekhide'] = 'Hide this week from {$a}';
$string['weeklyoutline'] = 'Weekly outline';
$string['weekshow'] = 'Show this week to {$a}';
$string['welcomeback'] = 'Welcome back, {$a}! 👋';
$string['welcometosite'] = 'Welcome, {$a}! 👋';
$string['welcomeback'] = 'Welcome back, {$a->firstname}! 👋';
$string['welcometosite'] = 'Welcome, {$a->firstname}! 👋';
$string['welcometocourse'] = 'Welcome to {$a}';
$string['welcometocoursetext'] = 'Welcome to {$a->coursename}!
+11 -1
View File
@@ -1189,7 +1189,17 @@ class core_user {
$messagekey = 'welcometosite';
set_user_preference('core_user_welcome', time());
}
return new lang_string($messagekey, 'core', $USER->firstname);
$namefields = [
'fullname' => fullname($USER),
'alternativefullname' => fullname($USER, true),
];
foreach (\core_user\fields::get_name_fields() as $namefield) {
$namefields[$namefield] = $USER->{$namefield};
}
return new lang_string($messagekey, 'core', $namefields);
};
return null;
}