translator moved to other address
[squirrelmail.git] / src / compose.php
index bbf93738a4f6a7bc017d109aa042e3c46d8854ed..949dbb1b8ba03a3cd909d02a2c83e54bfda25901 100644 (file)
  *    - Send mail
  *    - Save As Draft
  *
- * $Id$
+ * @version $Id$
  * @package squirrelmail
  */
 
-/** Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
@@ -98,6 +101,8 @@ if ( !sqgetGlobalVar('smaction',$action) )
   if ( sqgetGlobalVar('smaction_reply_all',$tmp) )  $action = 'reply_all';
   if ( sqgetGlobalVar('smaction_forward',$tmp) )    $action = 'forward';
   if ( sqgetGlobalVar('smaction_attache',$tmp) )    $action = 'forward_as_attachment';
+  if ( sqgetGlobalVar('smaction_draft',$tmp) )      $action = 'draft';
+  if ( sqgetGlobalVar('smaction_edit_new',$tmp) )   $action = 'edit_as_new';
 }
 
 /* Location (For HTTP 1.1 Header("Location: ...") redirects) */
@@ -661,6 +666,11 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
 
         $identity = '';
         $from_o = $orig_header->from;
+        if (is_array($from_o)) {
+            if (isset($from_o[0])) {
+                $from_o = $from_o[0];
+            }
+        }
         if (is_object($from_o)) {
             $orig_from = $from_o->getAddress();
         } else {
@@ -682,8 +692,6 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
             if ($identity_match) {
                 $identity = $identity_match;
             }
-        // we need identiy here fore draft case #845290
-        // echo $identity."leer";
         }
 
         switch ($action) {
@@ -987,12 +995,13 @@ function showInputForm ($session, $values=false) {
                     html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) .
                     _("From:") . '</td>' . "\n" .
                     html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) .
-             '         '.
-            addSelect('identitiy', $ident_list, $identity, TRUE);
+              '         '.
+              addSelect('identity', $ident_list, $identity, TRUE);
 
         echo '      </td>' . "\n" .
              '   </tr>' . "\n";
     }
+
     echo '   <tr>' . "\n" .
                 html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) .
                 _("To:") . '</TD>' . "\n" .
@@ -1350,18 +1359,6 @@ function deliverMessage($composeMessage, $draft=false) {
            $domain, $action, $default_move_to_sent, $move_to_sent;
     global $imapServerAddress, $imapPort, $sent_folder, $key;
 
-    /* some browsers replace <space> by nonbreaking spaces &nbsp;
-       by replacing them back to spaces addressparsing works */
-    /* FIXME: How to handle in case of other charsets where "\240"
-       is not a non breaking space ??? */
-    /* THEFIX: browsers don't replace space with nbsp. SM replaces
-       space with nbsp when decodes headers. If problem still happens,
-       use cleanup_nbsp() */
-
-//    $send_to = str_replace("\240",' ',$send_to);
-//    $send_to_cc = str_replace("\240",' ',$send_to_cc);
-//    $send_to_bcc = str_replace("\240",' ',$send_to_bcc);
-
     $rfc822_header = $composeMessage->rfc822_header;
 
     $abook = addressbook_init(false, true);
@@ -1490,7 +1487,7 @@ function deliverMessage($composeMessage, $draft=false) {
            unset ($imap_deliver);
            return $length;
         } else {
-           $msg  = '<br>Error: '._("Draft folder")." $draft_folder" . ' does not exist.';
+           $msg  = '<br />'.sprintf(_("Error: Draft folder %s does not exist."), $draft_folder);
            plain_error_message($msg, $color);
            return false;
         }
@@ -1501,7 +1498,7 @@ function deliverMessage($composeMessage, $draft=false) {
         $succes = $deliver->finalizeStream($stream);
     }
     if (!$succes) {
-        $msg  = $deliver->dlv_msg . '<br>' .
+        $msg  = $deliver->dlv_msg . '<br />' .
                 _("Server replied: ") . $deliver->dlv_ret_nr . ' '.
                 $deliver->dlv_server_msg;
         plain_error_message($msg, $color);