require_once('../functions/display_messages.php');
require_once('../functions/plugin.php');
+/* --------------------- Specific Functions ------------------------------ */
+
+
+
+/**
+ * Does the opposite of sqWordWrap()
+ */
+function sqUnWordWrap(&$body) {
+ $lines = explode("\n", $body);
+ $body = '';
+ $PreviousSpaces = '';
+ for ($i = 0; $i < count($lines); $i ++) {
+ ereg("^([\t >]*)([^\t >].*)?$", $lines[$i], $regs);
+ $CurrentSpaces = $regs[1];
+ if (isset($regs[2])) {
+ $CurrentRest = $regs[2];
+ }
+
+ if ($i == 0) {
+ $PreviousSpaces = $CurrentSpaces;
+ $body = $lines[$i];
+ } else if (($PreviousSpaces == $CurrentSpaces) /* Do the beginnings match */
+ && (strlen($lines[$i - 1]) > 65) /* Over 65 characters long */
+ && strlen($CurrentRest)) { /* and there's a line to continue with */
+ $body .= ' ' . $CurrentRest;
+ } else {
+ $body .= "\n" . $lines[$i];
+ $PreviousSpaces = $CurrentSpaces;
+ }
+ }
+ $body .= "\n";
+}
+
+/* ----------------------------------------------------------------------- */
+
if (!isset($attachments)) {
$attachments = array();
session_register('attachments');
function newMail () {
global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body,
$reply_id, $send_to, $send_to_cc, $mailbox, $send_to_bcc, $editor_size,
- $draft_id, $use_signature, $composesession;
+ $draft_id, $use_signature, $composesession, $forward_cc;
$send_to = decodeHeader($send_to, false);
$send_to_cc = decodeHeader($send_to_cc, false);
$bodyTop .= ' ' . $orig_header->to[$x] . "\n";
}
}
+ if (isset($forward_cc) && $forward_cc) {
+ $bodyTop .= _("Cc") . ': ' . $orig_header->cc[0] . "\n";
+ if (count($orig_header->cc) > 1) {
+ for ($x = 1; $x < count($orig_header->cc); $x++) {
+ $bodyTop .= ' ' . $orig_header->cc[$x] . "\n";
+ }
+ }
+ }
$bodyTop .= "\n";
$body = $bodyTop . $body;
}
$from_htmladdr_search, $location_of_buttons, $attachment_dir,
$username, $data_dir, $identity, $draft_id, $delete_draft,
$mailprio, $default_use_mdn, $mdn_user_support, $compose_new_win,
- $saved_draft, $mail_sent;
+ $saved_draft, $mail_sent, $sig_first;
$subject = decodeHeader($subject, false);
$reply_subj = decodeHeader($reply_subj, false);
echo ' <TR>' . "\n" .
' <TD BGCOLOR="' . $color[4] . '" COLSPAN=2>' . "\n" .
' <TEXTAREA NAME=body ROWS=20 COLS="' .
- $editor_size . '" WRAP=HARD>' . htmlspecialchars($body);
+ $editor_size . '" WRAP=HARD>';
if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
- echo "\n\n".($prefix_sig==true? "-- \n":'').htmlspecialchars($signature);
+ if ($sig_first == '1') {
+ echo "\n\n".($prefix_sig==true? "-- \n":'').htmlspecialchars($signature);
+ echo "\n\n".htmlspecialchars($body);
+ }
+ else {
+ echo "\n\n".htmlspecialchars($body);
+ echo "\n\n".($prefix_sig==true? "-- \n":'').htmlspecialchars($signature);
+ }
+ }
+ else {
+ echo htmlspecialchars($body);
}
echo '</TEXTAREA><BR>' . "\n" .
' </TD>' . "\n" .
$end = '">';
break;
case 'user-defined':
- $start = $reply_citation_start;
+ $start = $reply_citation_start . ' ';
$end = $reply_citation_end;
break;
default: