Always use value from Horde_Registry::getEmailCharset().
$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);
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']) &&
break;
}
$title .= ' ' . $header['subject'];
-
- $charset = $reply_msg['charset'];
break;
case 'forward_attach':
$format = $fwd_msg['format'];
$rtemode = ($rtemode || (!is_null($rtemode) && ($format == 'html')));
$title = $header['title'];
- $charset = $fwd_msg['charset'];
break;
case 'redirect_compose':
$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);
*
* @return mixed An array with the following keys:
* <pre>
- * 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'.
$this->_metadata['draft_uid_resume'] = $indices;
$this->changed = 'changed';
+ $this->charset = $charset;
+
return array(
- 'charset' => $charset,
'header' => $header,
'identity' => $identity_id,
'mode' => $mode,
* @return array An array with the following keys:
* <pre>
* '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
$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);
}
/**
* @return array An array with the following keys:
* <pre>
* '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
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'
);
}
</td>
</tr>
-<if:unlocked_charset>
- <tr>
- <td class="light rightAlign">
- <strong><tag:charset_label /></strong>
- </td>
- <td class="item">
- <select id="charset" name="charset" tabindex="<tag:charset_tabindex />">
-<loop:charset_array>
- <option value="<tag:charset_array.value />" <if:charset_array.selected>selected="selected" </if:charset_array.selected>><tag:charset_array.label /></option>
-</loop:charset_array>
- </select>
- </td>
- </tr>
-</if:unlocked_charset>
-
<if:set_priority>
<tr>
<td class="light rightAlign">