summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-10-06 06:55:08 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-10-06 06:55:08 +0000
commit17d0890a78ad087727910a66f60a804d40f1a20d (patch)
tree3f86d282a7f069f47a2d6280e85c21176b350233 /roundcubemail/program/steps
parent882c85d38a0544a9c08b4b5d5a9f8e65007edab5 (diff)
Hold attachment info in a js list in order to simplify things + codestyle
git-svn-id: https://svn.roundcube.net/trunk@3021 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/attachments.inc6
-rw-r--r--roundcubemail/program/steps/mail/compose.inc6
2 files changed, 10 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/attachments.inc b/roundcubemail/program/steps/mail/attachments.inc
index 28d6108d4..d97b9c413 100644
--- a/roundcubemail/program/steps/mail/attachments.inc
+++ b/roundcubemail/program/steps/mail/attachments.inc
@@ -111,7 +111,11 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
$content .= Q($attachment['name']);
- $OUTPUT->command('add2attachment_list', "rcmfile$id", $content, $uploadid);
+ $OUTPUT->command('add2attachment_list', "rcmfile$id", array(
+ 'html' => $content,
+ 'name' => $attachment['name'],
+ 'mimetype' => $attachment['mimetype'],
+ 'complete' => true), $uploadid);
}
else { // upload failed
$err = $_FILES['_attachments']['error'][$i];
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc
index c894da776..276efda56 100644
--- a/roundcubemail/program/steps/mail/compose.inc
+++ b/roundcubemail/program/steps/mail/compose.inc
@@ -781,6 +781,7 @@ function rcmail_compose_attachment_list($attrib)
$attrib['id'] = 'rcmAttachmentList';
$out = "\n";
+ $jslist = array();
if (is_array($_SESSION['compose']['attachments']))
{
@@ -798,12 +799,14 @@ function rcmail_compose_attachment_list($attrib)
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 @@ function rcmail_compose_attachment_list($attrib)
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);