Now users, if allowed, can select their prefered email encoding.

Merged from MOODLE_16_UTF8. Abandoning the branch.
This commit is contained in:
stronk7 2006-01-05 17:11:31 +00:00
parent 2bc0b7a0c4
commit 2b2b378f7f
2 changed files with 26 additions and 0 deletions

View File

@ -134,6 +134,24 @@ if (isadmin()) {
choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
</td>
</tr>
<?php if (!empty($CFG->allowusermailcharset)) { ?>
<tr>
<th><?php print_string("emailcharset") ?>:</th>
<td><?php
$mailcharset = get_user_preferences('mailcharset', '0', $user->id);
unset($choices);
unset($charsets);
$charsets = get_list_of_charsets();
if (!empty($CFG->sitemailcharset)) {
$choices['0'] = get_string('site').' ('.$CFG->sitemailcharset.')';
} else {
$choices['0'] = get_string('default').' ('.current_charset().')';
}
$choices = array_merge($choices, $charsets);
choose_from_menu($choices, 'mailcharset', $mailcharset, ''); ?>
</td>
</tr>
<?php } ?>
<tr>
<th><?php print_string('emaildigest') ?>:</th>
<td><?php

View File

@ -95,6 +95,14 @@
$usernew->maildisplay = clean_param($usernew->maildisplay, PARAM_INT);
$usernew->mailformat = clean_param($usernew->mailformat, PARAM_INT);
if ($CFG->allowusermailcharset) {
$usernew->mailcharset = clean_param($usernew->mailcharset, PARAM_CLEAN);
if (!empty($usernew->mailcharset)) {
set_user_preference('mailcharset', $usernew->mailcharset, $user->id);
}
} else {
unset_user_preference('mailcharset', $user->id);
}
$usernew->maildigest = clean_param($usernew->maildigest, PARAM_INT);
$usernew->autosubscribe = clean_param($usernew->autosubscribe, PARAM_INT);
if (!empty($CFG->htmleditor)) {