From: Michael M Slusarz Date: Tue, 4 Jan 2011 19:14:03 +0000 (-0700) Subject: Don't give option to change sending charset in IMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ae9cca9e421ab957eb001fe3c077a863efeb7429;p=horde.git Don't give option to change sending charset in IMP Always use value from Horde_Registry::getEmailCharset(). --- diff --git a/imp/compose.php b/imp/compose.php index 3cbdc4c0a..efc18770f 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -128,14 +128,6 @@ try { $imp_ui = new IMP_Ui_Compose(); $stationery = $injector->getInstance('IMP_Compose_Stationery'); -/* Set charset defaults. */ -$charset = $prefs->isLocked('sending_charset') - ? $prefs->getValue('sending_charset') - : $vars->charset; -if ($charset) { - $imp_compose->charset = $charset; -} - /* Is this a popup window? */ $isPopup = ($prefs->getValue('compose_popup') || $vars->popup); @@ -234,7 +226,6 @@ case 'draft': if (!is_null($rtemode)) { $rtemode = ($result['mode'] == 'html'); } - $charset = $result['charset']; $msg = $result['msg']; $header = array_merge($header, $result['header']); if (!is_null($result['identity']) && @@ -286,8 +277,6 @@ case 'reply_list': break; } $title .= ' ' . $header['subject']; - - $charset = $reply_msg['charset']; break; case 'forward_attach': @@ -307,7 +296,6 @@ case 'forward_both': $format = $fwd_msg['format']; $rtemode = ($rtemode || (!is_null($rtemode) && ($format == 'html'))); $title = $header['title']; - $charset = $fwd_msg['charset']; break; case 'redirect_compose': @@ -817,22 +805,6 @@ if ($redirect) { $t->set('help-subject', Horde_Help::link('imp', 'compose-subject')); $t->set('set_priority', $prefs->getValue('set_priority')); - $t->set('unlocked_charset', !$prefs->isLocked('sending_charset')); - if ($t->get('unlocked_charset')) { - $t->set('charset_label', Horde::label('charset', _("C_harset"))); - $t->set('charset_tabindex', ++$tabindex); - $charset_array = array(); - $enc_list = $registry->nlsconfig->encodings; - asort($enc_list); - foreach (array_merge(array('' => _("Default")), $enc_list) as $encoding => $label) { - $charset_array[] = array( - 'label' => $label, - 'selected' => (strcasecmp($encoding, $charset) === 0), - 'value' => $encoding - ); - } - $t->set('charset_array', $charset_array); - } if ($t->get('set_priority')) { $t->set('priority_label', Horde::label('priority', _("_Priority"))); $t->set('priority_tabindex', ++$tabindex); diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 3f8035a14..31bae8460 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -308,7 +308,6 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator * * @return mixed An array with the following keys: *
-     * charset - (string) The preferred sending charset.
      * header - (array) A list of headers to add to the outgoing message.
      * identity - (integer) The identity used to create the message.
      * mode - (string) 'html' or 'text'.
@@ -447,8 +446,9 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator
         $this->_metadata['draft_uid_resume'] = $indices;
         $this->changed = 'changed';
 
+        $this->charset = $charset;
+
         return array(
-            'charset' => $charset,
             'header' => $header,
             'identity' => $identity_id,
             'mode' => $mode,
@@ -1307,7 +1307,6 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator
      * @return array  An array with the following keys:
      * 
      * 'body'     - The text of the body part
-     * 'charset'  - The guessed charset to use for the reply
      * 'format'   - The format of the body message
      * 'headers'  - The headers of the message to use for the reply
      * 'identity' - The identity to use for the reply based on the original
@@ -1485,11 +1484,18 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator
             $this->changed = 'changed';
         }
 
+        $ret = $this->replyMessageText($contents);
+        if ($ret['charset'] != $this->charset) {
+            $this->charset = $ret['charset'];
+            $this->changed = 'changed';
+        }
+        unset($ret['charset']);
+
         return array_merge(array(
             'headers' => $header,
             'identity' => $match_identity,
             'type' => $reply_type
-        ), $this->replyMessageText($contents));
+        ), $ret);
     }
 
     /**
@@ -1589,7 +1595,6 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator
      * @return array  An array with the following keys:
      * 
      * 'body'     - The text of the body part
-     * 'charset'  - The guessed charset to use for the reply
      * 'format'   - The format of the body message
      * 'headers'  - The headers of the message to use for the reply
      * 'identity' - The identity to use for the reply based on the original
@@ -1643,16 +1648,16 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator
             in_array($type, array('forward_attach', 'forward_both'))) {
             try {
                 $this->attachImapMessage(new IMP_Indices($contents));
-            } catch (IMP_Exception $e) {
-            }
+            } catch (IMP_Exception $e) {}
         }
 
         if (in_array($type, array('forward_body', 'forward_both'))) {
             $ret = $this->forwardMessageText($contents);
+            $this->charset = $ret['charset'];
+            unset($ret['charset']);
         } else {
             $ret = array(
                 'body' => '',
-                'charset' => '',
                 'format' => $GLOBALS['prefs']->getValue('compose_html') ? 'html' : 'text'
             );
         }
diff --git a/imp/templates/imp/compose/compose.html b/imp/templates/imp/compose/compose.html
index 8d1af2b65..861149f2a 100644
--- a/imp/templates/imp/compose/compose.html
+++ b/imp/templates/imp/compose/compose.html
@@ -69,21 +69,6 @@
   
  
 
-
- 
-  
-   
-  
-  
-   
-  
- 
-
-