From 1fb5874f276e9ce7731e8f166b19a371ce33b894 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 27 Apr 2009 03:24:11 -0400
Subject: [PATCH] - fix attachment mimetype setting after upload - move style of delete button in attachment-list to mail.css file

---
 program/steps/mail/attachments.inc |    6 +++---
 program/steps/mail/compose.inc     |    4 ++--
 skins/default/mail.css             |    6 ++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index 6d58edc..81ac2fe 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -79,10 +79,11 @@
     $attachment = array(
       'path' => $filepath,
       'name' => $_FILES['_attachments']['name'][$i],
-      'mimetype' => rc_mime_content_type($tmpfname, $_FILES['_attachments']['type'][$i])
+      'mimetype' => rc_mime_content_type($filepath, $_FILES['_attachments']['type'][$i])
     );
 
     $attachment = $RCMAIL->plugins->exec_hook('upload_attachment', $attachment);
+
     if ($attachment['status']) {
       $id = $attachment['id'];
       
@@ -93,8 +94,7 @@
       if (is_file($icon = $CONFIG['skin_path'] . '/images/icons/remove-attachment.png')) {
         $button = html::img(array(
           'src' => $icon,
-          'alt' => rcube_label('delete'),
-          'style' => "padding-right:2px;vertical-align:middle",
+          'alt' => rcube_label('delete')
         ));
       }
       else {
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 9739a97..9328cc5 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -715,8 +715,8 @@
     if ($attrib['deleteicon'])
       $button = html::img(array(
         'src' => $CONFIG['skin_path'] . $attrib['deleteicon'],
-        'alt' => rcube_label('delete'),
-        'style' => "padding-right:2px;vertical-align:middle"));
+        'alt' => rcube_label('delete')
+	));
     else
       $button = Q(rcube_label('delete'));
 
diff --git a/skins/default/mail.css b/skins/default/mail.css
index ab4579e..c66998d 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -1016,6 +1016,12 @@
   overflow: hidden;
 }
 
+#compose-attachments ul li img
+{
+  padding-right: 2px;
+  vertical-align: middle;
+}
+
 #attachment-title
 {
   background: url(images/icons/attachment.png) top left no-repeat;

--
Gitblit v1.9.1