Issue #935208 by droplet, assert0, adrinux, Tor Arne Thune: Fixed PECL uploadprogress bar doesn't appear.

merge-requests/26/head
webchick 2011-11-11 12:35:14 -08:00
parent 77c0c9a48c
commit 4cea9fad25
3 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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,
);

View File

@ -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,
);
}