';
@@ -2314,14 +2317,12 @@ class mail_compose
$this->sessionData['body'] .= '
';
$this->sessionData['body'] = mail_ui::resolve_inline_images($this->sessionData['body'], $_folder, $_uid, $_partID, 'html');
- } else {
- //$this->sessionData['body'] = @htmlspecialchars(lang("on")." ".$headers['DATE']." ".$mail_bo->decode_header($fromAddress), ENT_QUOTES) . " ".lang("wrote").":\r\n";
- // take care the way the ReplyHeader is created here, is used later on in uicompose::compose, in case you force replys to be HTML (prefs)
- $this->sessionData['body'] = " \r\n \r\n".'----------------'.lang("original message").'-----------------'."\r\n".
- @htmlspecialchars(lang("from")).": ".$fromAddress."\r\n".
- $toAddress.$ccAddress.
- @htmlspecialchars(lang("date").": ".Mail::_strtotime($headers['DATE'],'r',true), ENT_QUOTES | ENT_IGNORE,Mail::$displayCharset, false)."\r\n".
- '-------------------------------------------------'."\r\n \r\n ";
+ }
+ else
+ {
+ // convert original message header to plain-text
+ $this->sessionData['body'] = self::convertHTMLToText($this->sessionData['body'], true, false, true);
+
$this->sessionData['mimeType'] = 'plain';
foreach($bodyParts as $i => &$bodyPart)
{
@@ -2368,11 +2369,30 @@ class mail_compose
}
+ /**
+ * Wrap html block in given tag with preferred font and -size set
+ *
+ * @param string $content
+ * @param string $legend
+ * @param ?string $class
+ * @return string
+ */
+ static function wrapBlockWithPreferredFont($content, $legend, $class=null)
+ {
+ $options = ' style="border: 2px solid silver; border-left: none; border-right: none;'.
+ 'font-family: '.($GLOBALS['egw_info']['user']['preferences']['common']['rtf_font'] ?? 'arial, helvetica, sans-serif').
+ '; font-size: '.($GLOBALS['egw_info']['user']['preferences']['common']['rtf_size'] ?? '10').'pt"';
+
+ if (!empty($class)) $options .= ' class="'.htmlspecialchars($class).'"';
+
+ return Api\Html::fieldset($content, $legend, $options);
+ }
+
/**
* HTML cleanup
*
* @param type $_body message
- * @param type $_useTidy = false, if true tidy extention will be loaded and tidy will try to clean body message
+ * @param type $_useTidy = false, if true tidy extension will be loaded and tidy will try to clean body message
* since the tidy causes segmentation fault ATM, we set the default to false.
* @return type
*/