summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-11-11 12:35:14 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2011-11-11 12:35:14 -0800
commit4cea9fad25be3b437f777217ed50ba1e7566a7d9 (patch)
tree16420f702b8d42553603a786439a1967aa4082b5 /modules/file
parent77c0c9a48cb63da96b1dc1020363324890418c44 (diff)
downloadbrdo-4cea9fad25be3b437f777217ed50ba1e7566a7d9.tar.gz
brdo-4cea9fad25be3b437f777217ed50ba1e7566a7d9.tar.bz2
Issue #935208 by droplet, assert0, adrinux, Tor Arne Thune: Fixed PECL uploadprogress bar doesn't appear.
Diffstat (limited to 'modules/file')
-rw-r--r--modules/file/file.css4
-rw-r--r--modules/file/file.field.inc1
-rw-r--r--modules/file/file.module11
3 files changed, 10 insertions, 6 deletions
diff --git a/modules/file/file.css b/modules/file/file.css
index aed1a9d34..40451b8ca 100644
--- a/modules/file/file.css
+++ b/modules/file/file.css
@@ -19,10 +19,6 @@
padding: 1px 5px 2px 5px;
}
-.form-managed-file div.ajax-progress div {
- display: inline;
-}
-
.form-managed-file div.ajax-progress-bar {
display: none;
margin-top: 4px;
diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc
index 35696dda6..7f5906ece 100644
--- a/modules/file/file.field.inc
+++ b/modules/file/file.field.inc
@@ -463,6 +463,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 5d7b17af5..f979a69fb 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -45,7 +45,6 @@ function file_menu() {
);
$items['file/progress'] = array(
'page callback' => 'file_ajax_progress',
- 'delivery callback' => 'ajax_deliver',
'access arguments' => array('access content'),
'theme callback' => 'ajax_base_page_theme',
'type' => MENU_CALLBACK,
@@ -384,7 +383,9 @@ function file_managed_file_process($element, &$form_state, $form) {
'#weight' => -5,
);
- $ajax_settings['progress']['type'] ? $ajax_settings['progress']['type'] == 'bar' : 'throbber';
+ // Force the progress indicator for the remove button to be either 'none' or
+ // 'throbber', even if the upload button is using something else.
+ $ajax_settings['progress']['type'] = ($element['#progress_indicator'] == 'none') ? 'none' : 'throbber';
$ajax_settings['progress']['message'] = NULL;
$ajax_settings['effect'] = 'none';
$element['remove_button'] = array(
@@ -412,6 +413,9 @@ 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') {
@@ -419,6 +423,9 @@ 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,
);
}