From: pdontthink Date: Fri, 9 Apr 2004 10:44:27 +0000 (+0000) Subject: I18N fix submitted by Fredrik Jervfors X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=46f2284fbb63ffe6f1b5c3e73e3633201688622a;ds=sidebyside I18N fix submitted by Fredrik Jervfors git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7053 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/compose.php b/src/compose.php index 2e1ed401..d1df5c2b 100644 --- a/src/compose.php +++ b/src/compose.php @@ -53,6 +53,7 @@ sqgetGlobalVar('mailbox',$mailbox); if(!sqgetGlobalVar('identity',$identity)) { $identity=0; } +sqgetGlobalVar('custom_from',$custom_from); sqgetGlobalVar('send_to',$send_to); sqgetGlobalVar('send_to_cc',$send_to_cc); sqgetGlobalVar('send_to_bcc',$send_to_bcc); @@ -978,6 +979,18 @@ function showInputForm ($session, $values=false) { showComposeButtonRow(); } + // additions for custom from plugin + // + $use_custom_from = getPref($data_dir, $username, 'use_custom_from', '0'); + global $restrict_access_to_users_file; + include_once(SM_PATH . 'plugins/custom_from/config/config.php'); + include_once(SM_PATH . 'plugins/custom_from/functions.php'); + if (!empty($restrict_access_to_users_file) + && file_exists($restrict_access_to_users_file)) + { + $use_custom_from = findUser($username, $restrict_access_to_users_file); + } + /* display select list for identities */ if (count($idents) > 1) { $ident_list = array(); @@ -989,12 +1002,52 @@ function showInputForm ($session, $values=false) { html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . _("From:") . '' . "\n" . html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) . - ' '. - addSelect('identity', $ident_list, $identity, TRUE); + ' ' . + ' ' . "\n" . + ' ' . "\n"; + } + echo ' ' . "\n" . html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . _("To:") . '' . "\n" . @@ -1349,7 +1402,8 @@ function deliverMessage($composeMessage, $draft=false) { global $send_to, $send_to_cc, $send_to_bcc, $mailprio, $subject, $body, $username, $popuser, $usernamedata, $identity, $idents, $data_dir, $request_mdn, $request_dr, $default_charset, $color, $useSendmail, - $domain, $action, $default_move_to_sent, $move_to_sent; + $domain, $action, $default_move_to_sent, $move_to_sent, + $custom_from; global $imapServerAddress, $imapPort, $sent_folder, $key; /* some browsers replace by nonbreaking spaces   @@ -1394,7 +1448,14 @@ function deliverMessage($composeMessage, $draft=false) { $from_mail = $idents[$identity]['email_address']; $full_name = $idents[$identity]['full_name']; $reply_to = $idents[$identity]['reply_to']; - if (!$from_mail) { + + // additions for custom from plugin + // + if (isset($custom_from) && !empty($custom_from)) { + $from_mail = $custom_from; + $full_name = ''; + $reply_to = $custom_from; + } else if (!$from_mail) { $from_mail = "$popuser@$domain"; } $rfc822_header->from = $rfc822_header->parseAddress($from_mail,true); @@ -1492,7 +1553,7 @@ function deliverMessage($composeMessage, $draft=false) { unset ($imap_deliver); return $length; } else { - $msg = '
Error: '._("Draft folder")." $draft_folder" . ' does not exist.'; + $msg = '
'.sprintf(_("Error: Draft folder %s does not exist."), $draft_folder); plain_error_message($msg, $color); return false; } @@ -1503,7 +1564,7 @@ function deliverMessage($composeMessage, $draft=false) { $succes = $deliver->finalizeStream($stream); } if (!$succes) { - $msg = $deliver->dlv_msg . '
' . + $msg = $deliver->dlv_msg . '
' . _("Server replied: ") . $deliver->dlv_ret_nr . ' '. $deliver->dlv_server_msg; plain_error_message($msg, $color);