Merge branch 'wip-MDL-20627-MOODLE_19_STABLE' of git://github.com/abgreeve/moodle into MOODLE_19_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2011-12-01 18:02:51 +01:00
3 changed files with 9 additions and 2 deletions
+1
View File
@@ -503,6 +503,7 @@ $string['emaildisable'] = 'This email address is disabled';
$string['emaildisableclick'] = 'Click here to disable all email from being sent to this address';
$string['emaildisplay'] = 'Email display';
$string['emaildisplaycourse'] = 'Allow only other course members to see my email address';
$string['emaildisplayhidden'] = 'Email hidden';
$string['emaildisplayno'] = 'Hide my email address from everyone';
$string['emaildisplayyes'] = 'Allow everyone to see my email address';
$string['emailenable'] = 'This email address is enabled';
+7 -1
View File
@@ -56,7 +56,13 @@
$course->teacher = get_string('defaultcourseteacher');
}
foreach ($SESSION->emailto[$id] as $user) {
echo '<tr><td>'.fullname($user,true).'</td><td>'.$user->email.'</td><td>';
echo '<tr><td>'.fullname($user,true).'</td>';
// Check to see if we should be showing the email address.
if ($user->maildisplay == 0 ) { // 0 = don't display my email to anyone.
echo '<td>' . get_string('emaildisplayhidden') . '</td><td>';
} else {
echo '<td>'.$user->email.'</td><td>';
}
if ($user->teacher) {
echo '<img src="'.$CFG->pixpath.'/t/user.gif" alt="'.$course->teacher.'" title="'.$course->teacher.'"/>';
}
+1 -1
View File
@@ -46,7 +46,7 @@
foreach ($_POST as $k => $v) {
if (preg_match('/^(user|teacher)(\d+)$/',$k,$m)) {
if (!array_key_exists($m[2],$SESSION->emailto[$id])) {
if ($user = get_record_select('user','id = '.$m[2],'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) {
if ($user = get_record_select('user','id = '.$m[2],'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess,maildisplay')) {
$SESSION->emailto[$id][$m[2]] = $user;
$SESSION->emailto[$id][$m[2]]->teacher = ($m[1] == 'teacher');
$count++;