message MDL-25264 made it possible to edit another user's message preferences

This commit is contained in:
Andrew Davis 2010-11-18 05:28:51 +00:00
parent 861fa9120d
commit fa8f03efbb
2 changed files with 11 additions and 4 deletions

View file

@ -67,7 +67,13 @@ class message_output_email extends message_output {
global $USER;
$string = get_string('email','message_email').': <input size="30" name="email_email" value="'.$preferences->email_email.'" />';
if (empty($preferences->email_email)) {
$string .= ' ('.get_string('default').': '.$USER->email.')';
$userdefaultemail = null;
if (empty($preferences->userdefaultemail)) {
$userdefaultemail = $USER->email;
} else {
$userdefaultemail = $preferences->userdefaultemail;
}
$string .= ' ('.get_string('default').': '.$userdefaultemail.')';
}
return $string;
}