| | |
| | | { |
| | | global $RCMAIL, $MESSAGE, $LINE_LENGTH; |
| | | |
| | | // build reply prefix |
| | | $from = array_pop($RCMAIL->imap->decode_address_list($MESSAGE->get_header('from'))); |
| | | $prefix = sprintf("On %s, %s wrote:", |
| | | $MESSAGE->headers->date, $from['name'] ? $from['name'] : idn_to_utf8($from['email'])); |
| | | |
| | | if (!$bodyIsHtml) { |
| | | $body = preg_replace('/\r?\n/', "\n", $body); |
| | | |
| | | |
| | | // try to remove the signature |
| | | if ($RCMAIL->config->get('strip_existing_sig', true)) { |
| | | $len = strlen($body); |
| | |
| | | // soft-wrap and quote message text |
| | | $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH); |
| | | |
| | | // add title line(s) |
| | | $prefix = sprintf("On %s, %s wrote:\n", |
| | | $MESSAGE->headers->date, |
| | | $MESSAGE->get_header('from')); |
| | | |
| | | $prefix .= "\n"; |
| | | $suffix = ''; |
| | | |
| | | |
| | | if ($RCMAIL->config->get('top_posting')) |
| | | $prefix = "\n\n\n" . $prefix; |
| | | } |
| | |
| | | $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map); |
| | | |
| | | // build reply (quote content) |
| | | $prefix = sprintf("<p>On %s, %s wrote:</p>\n", |
| | | $MESSAGE->headers->date, |
| | | htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $RCMAIL->output->get_charset())); |
| | | $prefix = '<p>' . Q($prefix) . "</p>\n"; |
| | | $prefix .= '<blockquote>'; |
| | | |
| | | if ($RCMAIL->config->get('top_posting')) { |
| | |
| | | |
| | | function rcmail_receipt_checkbox($attrib) |
| | | { |
| | | global $MESSAGE, $compose_mode; |
| | | global $RCMAIL, $MESSAGE, $compose_mode; |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib); |
| | | unset($attrib['form']); |
| | |
| | | $attrib['value'] = '1'; |
| | | $checkbox = new html_checkbox($attrib); |
| | | |
| | | if ($MESSAGE && in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) |
| | | $mdn_default = (bool) $MESSAGE->headers->mdn_to; |
| | | else |
| | | $mdn_default = $RCMAIL->config->get('mdn_default'); |
| | | |
| | | $out = $form_start ? "$form_start\n" : ''; |
| | | $out .= $checkbox->show(in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT)) |
| | | && $MESSAGE->headers->mdn_to ? 1 : 0); |
| | | $out .= $checkbox->show($mdn_default); |
| | | $out .= $form_end ? "\n$form_end" : ''; |
| | | |
| | | return $out; |