alecpl
2010-11-14 6084d782f2e6e57248463bf10b99eeee543e0049
program/steps/mail/compose.inc
@@ -112,7 +112,8 @@
// add some labels to client
$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'cancel',
    'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', 
    'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'fileuploaderror');
    'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'fileuploaderror',
    'autocompletechars');
// add config parameters to client script
if (!empty($CONFIG['drafts_mbox'])) {
@@ -123,6 +124,7 @@
$OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
$OUTPUT->set_env('sig_above', $CONFIG['sig_above']);
$OUTPUT->set_env('top_posting', $CONFIG['top_posting']);
$OUTPUT->set_env('autocomplete_min_length', $CONFIG['autocomplete_min_length']);
// get reference message and set compose mode
if ($msg_uid = $_SESSION['compose']['param']['reply_uid'])
@@ -644,9 +646,20 @@
  $out .= $msgtype->show();
  // If desired, set this textarea to be editable by TinyMCE
  if ($isHtml) $attrib['class'] = 'mce_editor';
  $textarea = new html_textarea($attrib);
  $out .= $textarea->show($MESSAGE_BODY);
  if ($isHtml) {
    $attrib['class'] = 'mce_editor';
    $textarea = new html_textarea($attrib);
    $out .= $textarea->show($MESSAGE_BODY);
  }
  else {
    $textarea = new html_textarea($attrib);
    $out .= $textarea->show('');
    // quote plain text, inject into textarea
    $table = get_html_translation_table(HTML_SPECIALCHARS);
    $MESSAGE_BODY = strtr($MESSAGE_BODY, $table);
    $out = substr($out, 0, -11) . $MESSAGE_BODY . '</textarea>';
  }
  $out .= $form_end ? "\n$form_end" : '';
  $OUTPUT->set_env('composebody', $attrib['id']);