From 8eefbb2158c43b51a8c33e6c480cbe61539b9535 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Aug 2012 04:16:04 -0400
Subject: [PATCH] Add option to enable HTML editor on forwarding (#1488517)

---
 CHANGELOG                             |    1 +
 program/steps/mail/compose.inc        |    7 +++++--
 program/steps/settings/func.inc       |    1 +
 program/localization/en_US/labels.inc |    3 ++-
 config/main.inc.php.dist              |    2 +-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f48ace4..d123003 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Add option to enable HTML editor on forwarding (#1488517)
 - Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
 - Fix Larry's messages list filter in IE (#1488632)
 - Fix more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 69a6ea2..7e07341 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -725,7 +725,7 @@
 $rcmail_config['show_images'] = 0;
 
 // compose html formatted messages by default
-// 0 - never, 1 - always, 2 - on reply to HTML message only 
+// 0 - never, 1 - always, 2 - on reply to HTML message, 3 - on forward or reply to HTML message
 $rcmail_config['htmleditor'] = 0;
 
 // show pretty dates as standard
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 88de277..9882c19 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -381,7 +381,8 @@
 $labels['signature'] = 'Signature';
 $labels['dstactive']  = 'Daylight saving time';
 $labels['htmleditor'] = 'Compose HTML messages';
-$labels['htmlonreply'] = 'on reply to HTML message only';
+$labels['htmlonreply'] = 'on reply to HTML message';
+$labels['htmlonreplyandforward'] = 'on forward or reply to HTML message';
 $labels['htmlsignature'] = 'HTML signature';
 $labels['previewpane'] = 'Show preview pane';
 $labels['skin'] = 'Interface skin';
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index c243c88..e57b44a 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -610,9 +610,12 @@
     $useHtml = $MESSAGE->has_html_part(false);
   }
   else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
-    $useHtml = ($html_editor == 1 || ($html_editor == 2 && $MESSAGE->has_html_part(false)));
+    $useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false)));
   }
-  else { // RCUBE_COMPOSE_FORWARD or NEW
+  else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
+    $useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false)));
+  }
+  else {
     $useHtml = ($html_editor == 1);
   }
 
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 6d548ef..59b4e37 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -470,6 +470,7 @@
       $select_htmleditor->add(rcube_label('never'), 0);
       $select_htmleditor->add(rcube_label('always'), 1);
       $select_htmleditor->add(rcube_label('htmlonreply'), 2);
+      $select_htmleditor->add(rcube_label('htmlonreplyandforward'), 3);
 
       $blocks['main']['options']['htmleditor'] = array(
         'title' => html::label($field_id, Q(rcube_label('htmleditor'))),

--
Gitblit v1.9.1