MDL-36600 user: improve course messaging checks
[moodle.git] / user / message.html
CommitLineData
b7dc2256 1<form id="theform" method="post" action="messageselect.php">
f19570d0 2<input type="hidden" name="id" value="<?php p($id) ?>" />
0cc875b7 3<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
f19570d0 4<input type="hidden" name="returnto" value="<?php p($returnto) ?>" />
5<input type="hidden" name="deluser" value="" />
3aac07d8 6<?php echo $OUTPUT->box_start(); ?>
f19570d0 7<table border="0" cellpadding="5">
8<tr valign="top">
9 <td align="right"><b>
10 <?php print_string("messagebody"); ?>:
11 </b></td>
12 <td align="left" rowspan="2">
13 <?php print_textarea($usehtmleditor, 25, 65, 630, 400, "messagebody", $messagebody); ?>
14 </td>
15</tr>
f19570d0 16
17<tr valign="top">
1445fd13 18 <td align="right"><label for="menuformat"><b><?php print_string("formattexttype"); ?>:</b></label></td>
f19570d0 19 <td>
20 <?php
21 if ($usehtmleditor) { /// Trying this out for a while
22 print_string('formathtml');
23 echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
24 } else {
25 choose_from_menu(format_text_menu(), "format", $format, "");
26 }
f19570d0 27 ?>
28 </td>
29</tr>
30
10f57780 31<tr><td align="center" colspan="2"><input type="submit" name="preview" value="<?php print_string('preview'); ?>" /></td></tr>
f19570d0 32</table>
3aac07d8 33<?php echo $OUTPUT->box_end(); ?>
fc9b712e 34<table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers'); ?></th></tr>
f19570d0 35<?php
36 if (count($SESSION->emailto[$id])) {
37 foreach ($SESSION->emailto[$id] as $user) {
e94113a8 38 echo '<tr><td>'.fullname($user,true).'</td>';
39 // Check to see if we should be showing the email address.
40 if ($user->maildisplay == 0) { // 0 = don't display my email to anyone.
41 echo '<td>' . get_string('emaildisplayhidden') . '</td><td>';
42 } else {
43 echo '<td>'.$user->email.'</td><td>';
44 }
46505ee7 45 if (empty($user->email)) {
f19570d0 46 $error = get_string('emailempty');
47 }
48 if (!empty($error)) {
b5d0cafc 49 echo '<img src="'.$OUTPUT->pix_url('t/emailno') . '" alt="'.$error.'" title="'.$error.'"/>';
f19570d0 50 unset($error);
51 }
10f57780 52 echo '</td><td><input type="submit" onClick="this.form.deluser.value='.$user->id.';" value="' . get_string('remove') . '" /></td></tr>';
f19570d0 53 }
54 }
55 else {
56 echo '<tr><td colspan="3" align="center">'.get_string('nousersyet').'</td></tr>';
57 }
58?>
59</table>
60</form>