From d9344fc349e8c5765898c90bf5061e56cd21c8a0 Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Tue, 15 Apr 2008 17:22:00 -0400
Subject: [PATCH] HTML editing fixes, upgrade to TinyMCE v3.0.6

---
 program/steps/mail/compose.inc |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 878cf86..0ee55f8 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -426,8 +426,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" : '';
@@ -799,9 +798,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 +814,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 +922,4 @@
  	$OUTPUT->set_env('contacts', $a_contacts); 
   } 
 $OUTPUT->send('compose');
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1