From ae6d2de17f740915e47c64d210680eb5e9850335 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 6 Jun 2012 17:35:21 +0200 Subject: New feature to add mail attachments using drag & drop on HTML5 enabled browsers --- program/steps/mail/compose.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'program/steps/mail/compose.inc') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 306de3608..70f657d8d 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -1590,6 +1590,19 @@ function rcmail_contacts_list($attrib = array()) } +/** + * Register a certain container as active area to drop files onto + */ +function compose_file_drop_area($attrib) +{ + global $OUTPUT; + + if ($attrib['id']) { + $OUTPUT->add_gui_object('filedrop', $attrib['id']); + $OUTPUT->set_env('filedrop', array('action' => 'upload', 'fieldname' => '_attachments')); + } +} + // register UI objects $OUTPUT->add_handlers(array( @@ -1599,6 +1612,7 @@ $OUTPUT->add_handlers(array( 'composeattachmentlist' => 'rcmail_compose_attachment_list', 'composeattachmentform' => 'rcmail_compose_attachment_form', 'composeattachment' => 'rcmail_compose_attachment_field', + 'filedroparea' => 'compose_file_drop_area', 'priorityselector' => 'rcmail_priority_selector', 'editorselector' => 'rcmail_editor_selector', 'receiptcheckbox' => 'rcmail_receipt_checkbox', -- cgit v1.2.3