From 7e4f90cc543e97264b7dcdc515ac9f9b7a486586 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 26 Jun 2018 11:17:23 +1000 Subject: [PATCH] test plupload in email form --- booking.email_manually.inc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/booking.email_manually.inc b/booking.email_manually.inc index b7345c3..32bdd60 100644 --- a/booking.email_manually.inc +++ b/booking.email_manually.inc @@ -129,7 +129,7 @@ function booking_manual_email_form($form, &$form_state) 'wrapper' => 'booking_email_default_ids_wrapper', ), ); - + /* $form['booking-email-attachment'] = array( '#type' => 'managed_file', '#title' => t('Email attachment'), @@ -140,6 +140,20 @@ function booking_manual_email_form($form, &$form_state) 'file_validate_extensions' => array(variable_get('booking_email_allowed_attachments', 'pdf docx')), ), ); + */ + $form['booking-email-attachment'] = array( + '#type' => 'plupload', + '#title' => t('Email attachment'), + '#description' => t('Attach a file to be emailed. Note that this only works with custom email types. File must be 10MB or less, and extension must be one of: ' . variable_get('booking_email_allowed_attachments', 'pdf docx')), + '#upload_validators' => array( + 'file_validate_size' => array(10*1024*1024), + 'file_validate_extensions' => array(variable_get('booking_email_allowed_attachments', 'pdf docx')), + ), + '#plupload_settings' => array( + 'runtimes' => 'html5', + 'chunk_size' => '1mb', + ), + ); $form['booking-email-preview'] = array( '#type' => 'container',