From 7a5c48e7f70b8bc938fcae3ffd2be0fdbeaab145 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 13 Dec 2006 02:17:24 -0500
Subject: [PATCH] Changed 'junk' label in French localization

---
 program/steps/mail/func.inc |  130 ++++++++++++++++++++++++++++++-------------
 1 files changed, 91 insertions(+), 39 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 986a4c9..9bda890 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -79,6 +79,7 @@
 
   // add some labels to client
   rcube_add_label('purgefolderconfirm');
+  rcube_add_label('deletemessagesconfirm');
   
 // $mboxlist_start = rcube_timer();
   
@@ -495,6 +496,7 @@
   $javascript .= sprintf("%s.set_env('messages', %s);", $JS_OBJECT_NAME, array2js($a_js_message_arr));
   
   $OUTPUT->add_script($javascript);  
+  $OUTPUT->include_script('list.js');
   
   return $out;
   }
@@ -511,8 +513,8 @@
   $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
 
   // show 'to' instead of from in sent messages
-  if (strtolower($IMAP->get_mailbox_name())=='sent' && ($f = array_search('from', $a_show_cols))
-      && !array_search('to', $a_show_cols))
+  if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox'])
+      && ($f = array_search('from', $a_show_cols)) && !array_search('to', $a_show_cols))
     $a_show_cols[$f] = 'to';
 
   $commands .= sprintf("this.set_message_coltypes(%s);\n", array2js($a_show_cols)); 
@@ -555,6 +557,27 @@
   return $commands;
   }
 
+
+// return an HTML iframe for loading mail content
+function rcmail_messagecontent_frame($attrib)
+  {
+  global $OUTPUT, $JS_OBJECT_NAME;
+  
+  if (empty($attrib['id']))
+    $attrib['id'] = 'rcmailcontentwindow';
+
+  // allow the following attributes to be added to the <iframe> tag
+  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
+  $framename = $attrib['id'];
+
+  $out = sprintf('<iframe name="%s"%s></iframe>'."\n",
+         $framename,
+         $attrib_str);
+
+  $OUTPUT->add_script("$JS_OBJECT_NAME.set_env('contentframe', '$framename');");
+
+  return $out;
+  }
 
 // return code for search function
 function rcmail_search_form($attrib)
@@ -633,10 +656,15 @@
     // show quota as image (by Brett Patterson)
     if ($attrib['display'] == 'image' && function_exists('imagegif'))
       {
-      $quota_text = sprintf('<img src="%s&amp;_action=quotaimg&amp;u=%s&amp;q=%d" alt="%s" width="102" height="15" />',
+      $attrib += array('width' => 100, 'height' => 14);
+      $quota_text = sprintf('<img src="%s&amp;_action=quotaimg&amp;u=%s&amp;q=%d&amp;w=%d&amp;h=%d" width="%d" height="%d" alt="%s" title="%s / %s" />',
                             $COMM_PATH,
                             $quota['used'], $quota['total'],
-                            $quota_text);
+                            $attrib['width'], $attrib['height'],
+                            $attrib['width'], $attrib['height'],
+                            $quota_text,
+                            show_bytes($quota["used"] * 1024),
+                            show_bytes($quota["total"] * 1024));
       }
     }
   else
@@ -684,7 +712,7 @@
   global $IMAP, $REMOTE_OBJECTS, $JS_OBJECT_NAME;
   
   $body = is_array($part->replaces) ? strtr($part->body, $part->replaces) : $part->body;
-  
+
   // text/html
   if ($part->ctype_secondary=='html')
     {
@@ -1077,12 +1105,12 @@
       else if ($part->type=='content')
         {
         if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset']))
-          $$part->ctype_parameters['charset'] = $MESSAGE['headers']->charset;
-         
+          $part->ctype_parameters['charset'] = $MESSAGE['headers']->charset;
+
         // fetch part if not available
         if (!isset($part->body))
           $part->body = $IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part);
-        
+
         $body = rcmail_print_body($part, $safe_mode);
         $out .= '<div class="message-part">';
         
@@ -1182,13 +1210,13 @@
                             '/(<\/?meta[^>]*>)/i'),
                       '<!--\\1-->',
                       $body);
-                      
+
   $out = preg_replace(array('/(<body[^>]*>)/i',
                             '/(<\/body>)/i'),
                       array('<div class="rcmBody">',
                             '</div>'),
                       $out);
-  
+
   return $out;
   }
 
@@ -1234,15 +1262,65 @@
   }
 
 
+function rcmail_has_html_part($message_parts)
+{
+   if (!is_array($message_parts))
+      return FALSE;
 
-// return first text part of a message
-function rcmail_first_text_part($message_struct)
+   // check all message parts
+   foreach ($message_parts as $pid => $part)
+   {
+      $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
+      if ($mimetype=='text/html')
+      {
+         return TRUE;
+      }
+   }
+    
+   return FALSE;
+}
+
+// return first HTML part of a message
+function rcmail_first_html_part($message_struct)
   {
   global $IMAP;
 
   if (!is_array($message_struct['parts']))
     return FALSE;
     
+  $html_part = NULL;
+
+  // check all message parts
+  foreach ($message_struct['parts'] as $pid => $part)
+    {
+    $mimetype = strtolower($part->ctype_primary.'/'.$part->ctype_secondary);
+    if ($mimetype=='text/html')
+      {
+      $html_part = $IMAP->get_message_part($message_struct['UID'], $pid, $part);
+      }
+    }
+
+  if ($html_part)
+    {
+    // remove special chars encoding
+    //$trans = array_flip(get_html_translation_table(HTML_ENTITIES));
+    //$html_part = strtr($html_part, $trans);
+
+    return $html_part;
+    }
+
+  return FALSE;
+}
+
+
+// return first text part of a message
+function rcmail_first_text_part($message_struct)
+  {
+  global $IMAP;
+
+  if (empty($message_struct['parts']))
+    return $message_struct['UID'] ? $IMAP->get_body($message_struct['UID']) : false;
+
   // check all message parts
   foreach ($message_struct['parts'] as $pid => $part)
     {
@@ -1379,42 +1457,16 @@
   }
 
 
-// create temp dir for attachments
-function rcmail_create_compose_tempdir()
-  {
-  global $CONFIG;
-  
-  if ($_SESSION['compose']['temp_dir'])
-    return $_SESSION['compose']['temp_dir'];
-  
-  if (!empty($CONFIG['temp_dir']))
-    $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id'];
-
-  // create temp-dir for uploaded attachments
-  if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir']))
-    {
-    mkdir($temp_dir);
-    $_SESSION['compose']['temp_dir'] = $temp_dir;
-    }
-
-  return $_SESSION['compose']['temp_dir'];
-  }
-
-
 // clear message composing settings
 function rcmail_compose_cleanup()
   {
   if (!isset($_SESSION['compose']))
     return;
-  
+
   // remove attachment files from temp dir
   if (is_array($_SESSION['compose']['attachments']))
     foreach ($_SESSION['compose']['attachments'] as $attachment)
       @unlink($attachment['path']);
-
-  // kill temp dir
-  if ($_SESSION['compose']['temp_dir'])
-    @rmdir($_SESSION['compose']['temp_dir']);
   
   unset($_SESSION['compose']);
   }

--
Gitblit v1.9.1