diff --git a/modules/file/file.css b/modules/file/file.css index aed1a9d..ac29fb5 100644 --- a/modules/file/file.css +++ b/modules/file/file.css @@ -20,7 +20,7 @@ } .form-managed-file div.ajax-progress div { - display: inline; + display: block; } .form-managed-file div.ajax-progress-bar { diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index 2af3cb6..83f7ace 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -482,6 +482,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco '#upload_validators' => file_field_widget_upload_validators($field, $instance), '#value_callback' => 'file_field_widget_value', '#process' => array_merge($element_info['#process'], array('file_field_widget_process')), + '#progress_indicator' => $instance['widget']['settings']['progress_indicator'], // Allows this field to return an array instead of a single value. '#extended' => TRUE, ); diff --git a/modules/file/file.module b/modules/file/file.module index 3e45251..aca7d94 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -311,7 +311,7 @@ function file_ajax_progress($key) { } } - drupal_json_output($progress); + return array('#type' => 'ajax', '#commands' => $progress); } /** @@ -409,6 +409,8 @@ function file_managed_file_process($element, &$form_state, $form) { '#type' => 'hidden', '#value' => $upload_progress_key, '#attributes' => array('class' => array('file-progress')), + // Uploadprogress extension requires this field to be at the top of the form + '#weight' => -20, ); } elseif ($implementation == 'apc') { @@ -416,6 +418,8 @@ function file_managed_file_process($element, &$form_state, $form) { '#type' => 'hidden', '#value' => $upload_progress_key, '#attributes' => array('class' => array('file-progress')), + // Uploadprogress extension requires this field to be at the top of the form + '#weight' => -20, ); }