From 01ffe039089e08fd6faaf03f4170853defd41fc8 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 06 Oct 2009 02:55:08 -0400
Subject: [PATCH] Hold attachment info in a js list in order to simplify things + codestyle

---
 program/steps/mail/compose.inc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index c894da7..276efda 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -781,6 +781,7 @@
     $attrib['id'] = 'rcmAttachmentList';
   
   $out = "\n";
+  $jslist = array();
   
   if (is_array($_SESSION['compose']['attachments']))
   {
@@ -798,12 +799,14 @@
       if (empty($a_prop))
         continue;
       
-      $out .= html::tag('li', array('id' => "rcmfile".$id),
+      $out .= html::tag('li', array('id' => 'rcmfile'.$id),
         html::a(array(
             'href' => "#delete",
             'title' => rcube_label('delete'),
             'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id)),
           $button) . Q($a_prop['name']));
+        
+        $jslist['rcmfile'.$id] = array('name' => $a_prop['name'], 'complete' => true, 'mimetype' => $a_prop['mimetype']);
     }
   }
 
@@ -814,6 +817,7 @@
   if ($attrib['loadingicon'])
     $OUTPUT->set_env('loadingicon', $CONFIG['skin_path'] . $attrib['loadingicon']);
 
+  $OUTPUT->set_env('attachments', $jslist);
   $OUTPUT->add_gui_object('attachmentlist', $attrib['id']);
     
   return html::tag('ul', $attrib, $out, html::$common_attrib);

--
Gitblit v1.9.1