diff --git a/mupload.module b/mupload.module index d64bbe8..8b55be5 100644 --- a/mupload.module +++ b/mupload.module @@ -229,40 +227,6 @@ function mupload_field_widget_process($element, &$form_state, &$form) { * wrapper around the entire group so it can be replaced all at once. */ function mupload_field_widget_process_multiple($element, &$form_state, $form) { - $upload_name = 'files_' . implode('_', $element['#parents']) . '_' . $element['#file_upload_delta']; - if (array_key_exists($upload_name, $_FILES)) { - $count = count($_FILES[$upload_name]['name']); - //Supposing #file_upload_delta is always the last delta this will work - for ($i = 1; $i < $count; $i++) { - $element[] = $element[$element['#file_upload_delta']]; - } - } - - $element_children = element_children($element, TRUE); - $count = count($element_children); - - foreach ($element_children as $delta => $key) { - if ($key < $element['#file_upload_delta']) { - $description = _file_field_get_description_from_element($element[$key]); - $element[$key]['_weight'] = array( - '#type' => 'weight', - '#title' => $description ? t('Weight for @title', array('@title' => $description)) : t('Weight for new file'), - '#title_display' => 'invisible', - '#delta' => $count, - '#default_value' => $delta, - ); - } - else { - // The title needs to be assigned to the upload field so that validation - // errors include the correct widget label. - $element[$key]['#title'] = $element['#title']; - $element[$key]['_weight'] = array( - '#type' => 'hidden', - '#default_value' => $delta, - ); - } - } - // Add a new wrapper around all the elements for AJAX replacement. $element['#prefix'] = '
'; $element['#suffix'] = '
';