mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
message MDL-25264 made it possible to edit another user's message preferences
This commit is contained in:
parent
861fa9120d
commit
fa8f03efbb
2 changed files with 11 additions and 4 deletions
|
@ -144,7 +144,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
|||
$preferences['message_blocknoncontacts'] = !empty($form->blocknoncontacts)?1:0;
|
||||
//$preferences['message_beepnewmessage'] = !empty($form->beepnewmessage)?1:0;
|
||||
|
||||
/// Save all the new preferences to the database
|
||||
// Save all the new preferences to the database
|
||||
if (!set_user_preferences( $preferences, $user->id ) ){
|
||||
print_error('cannotupdateusermsgpref');
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
|||
|
||||
/// Load preferences
|
||||
$preferences = new stdClass();
|
||||
$preferences->userdefaultemail = $user->email;//may be displayed by the email processor
|
||||
|
||||
/// Get providers preferences
|
||||
$providers = message_get_my_providers();
|
||||
|
@ -204,8 +205,8 @@ if ($course->id != SITEID) {
|
|||
}
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// Start the form. We're not using mform here because of our special formatting needs ...
|
||||
echo '<form class="mform" method="post" action="'.$CFG->wwwroot.'/message/edit.php">';
|
||||
// Start the form. We're not using mform here because of our special formatting needs ...
|
||||
echo '<form class="mform" method="post" action="'.$PAGE->url.'">';
|
||||
|
||||
/// Settings table...
|
||||
echo '<fieldset id="providers" class="clearfix">';
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue