svncommit
2009-05-12 617b4f699f2e47991c50e05528b1f9ecbc3c3d9c
program/steps/mail/compose.inc
@@ -363,7 +363,7 @@
  }
  else if ($compose_mode)
  {
    if ($isHtml && $MESSAGE->has_html_part())
    if (($isHtml || $compose_mode == RCUBE_COMPOSE_DRAFT) && $MESSAGE->has_html_part())
    {
      $body = $MESSAGE->first_html_part();
      $isHtml = true;
@@ -433,6 +433,7 @@
      "googie.lang_no_error_found = \"%s\";\n".
      "googie.setLanguages(%s);\n".
      "googie.setCurrentLanguage('%s');\n".
      "googie.setSpellContainer('spellcheck-control');\n".
      "googie.decorateTextarea('%s');\n".
      "%s.set_env('spellcheck', googie);",
      $RCMAIL->comm_path,
@@ -672,14 +673,14 @@
  }
  // create a reply-subject
  else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
    if (eregi('^re:', $MESSAGE->subject))
    if (preg_match('/^re:/i', $MESSAGE->subject))
      $subject = $MESSAGE->subject;
    else
      $subject = 'Re: '.$MESSAGE->subject;
  }
  // create a forward-subject
  else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
    if (eregi('^fwd:', $MESSAGE->subject))
    if (preg_match('/^fwd:/i', $MESSAGE->subject))
      $subject = $MESSAGE->subject;
    else
      $subject = 'Fwd: '.$MESSAGE->subject;
@@ -834,23 +835,26 @@
{
  global $CONFIG, $MESSAGE, $compose_mode;
  $choices = array(
    'html'  => 'htmltoggle',
    'plain' => 'plaintoggle'
  );
  // determine whether HTML or plain text should be checked
  $useHtml = $CONFIG['htmleditor'] ? true : false;
  if ($compose_mode)
    $useHtml = ($useHtml && $MESSAGE->has_html_part());
  $editorid = empty($attrib['editorid']) ? 'rcmComposeMessage' : $attrib['editorid'];
  if (empty($attrib['editorid']))
    $attrib['editorid'] = 'rcmComposeMessage';
  $selector = '';
  $chosenvalue = $useHtml ? 'html' : 'plain';
  $radio = new html_radiobutton(array('name' => '_editorSelect',
    'onclick' => "return rcmail_toggle_editor(this.value=='html', '$editorid', '_is_html')"));
  if (empty($attrib['name']))
    $attrib['name'] = 'editorSelect';
    $attrib['onchange'] = "return rcmail_toggle_editor(this.value=='html', '".$attrib['editorid']."', '_is_html')";
  $select = new html_select($attrib);
  $select->add(Q(rcube_label('htmltoggle')), 'html');
  $select->add(Q(rcube_label('plaintoggle')), 'plain');
  return $select->show($useHtml ? 'html' : 'plain');
  foreach ($choices as $value => $text)
  {