svncommit
2008-04-15 8e5defd55f02cfd5f438cfdee823221bb3e8ed45
program/steps/mail/compose.inc
@@ -410,9 +410,15 @@
    $body = rcmail_create_draft_body($body, $isHtml);
    }
  $tinylang = substr($_SESSION['user_lang'], 0, 2);
  if (!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js'))
    {
    $tinylang = 'en';
    }
  $OUTPUT->include_script('tiny_mce/tiny_mce.js');
  $OUTPUT->include_script("editor.js");
  $OUTPUT->add_script('rcmail_editor_init("$__skin_path");');
  $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.$tinylang.'");');
  $out = $form_start ? "$form_start\n" : '';
@@ -426,8 +432,7 @@
  $out .= $msgtype->show();
  // If desired, set this text area to be editable by TinyMCE
  if ($isHtml)
    $attrib['mce_editable'] = "true";
  if ($isHtml) $attrib['class'] = "mce_editor";
  $textarea = new html_textarea($attrib);
  $out .= $textarea->show($body);
  $out .= $form_end ? "\n$form_end" : '';
@@ -499,7 +504,7 @@
             $IMAP->decode_header($MESSAGE['headers']->from));
    // try to remove the signature
    if ($sp = strrstr($body, '-- '))
    if ($sp = strrpos($body, '-- '))
      {
      if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r")
        $body = substr($body, 0, $sp-1);
@@ -799,9 +804,13 @@
  // determine whether HTML or plain text should be checked 
  if ($CONFIG['htmleditor'])
    {
    $useHtml = true;
    }
  else
    {
    $useHtml = false;
    }
  if ($compose_mode == RCUBE_COMPOSE_REPLY ||
      $compose_mode == RCUBE_COMPOSE_FORWARD ||
@@ -811,23 +820,19 @@
    $useHtml = ($hasHtml && $CONFIG['htmleditor']);
  }
  $chosenvalue = $useHtml ? 'html' : 'plain';
  $selector = '';
  
  $attrib['name'] = '_editorSelect';
  $attrib['onchange'] = 'return rcmail_toggle_editor(this)';
  foreach ($choices as $value => $text)
  {
    $checked = '';
    if ((($value == 'html') && $useHtml) ||
        (($value != 'html') && !$useHtml))
      $attrib['checked'] = 'true';
    else
      unset($attrib['checked']);
    $attrib['id'] = '_' . $value;
    $attrib['value'] = $value;
    $rb = new html_radiobutton($attrib);
    $selector .= sprintf("%s<label for=\"%s\">%s</label>",
                         $rb->show($value),
                         $rb->show($chosenvalue),
                         $attrib['id'],
                         rcube_label($text));
  }
@@ -923,4 +928,4 @@
    $OUTPUT->set_env('contacts', $a_contacts); 
  } 
$OUTPUT->send('compose');
?>
?>