You are here

function media_browser_plus_form_file_entity_add_upload_multiple_alter in Media Browser Plus 7.2

Same name and namespace in other branches
  1. 7.3 media_browser_plus.module \media_browser_plus_form_file_entity_add_upload_multiple_alter()

Implements hook_form_FORM_ID_alter() for file_entity_add_upload_multiple().

1 call to media_browser_plus_form_file_entity_add_upload_multiple_alter()
media_browser_plus_form_media_add_upload_multiple_alter in ./media_browser_plus.module
Implements hook_form_FORM_ID_alter() for media_add_upload_multiple().

File

./media_browser_plus.module, line 196
Adds fields to the media browser forms for better UX

Code

function media_browser_plus_form_file_entity_add_upload_multiple_alter(&$form, &$form_state) {

  // This builds the tags textfield and adds the autocomplete handlers to it.
  // The #element_validate may not be necessary because this never triggers
  // hook_field_update() or hook_field_insert()
  $form['field_tags'] = _media_browser_plus_tag_form();
  $form['field_folder'] = _media_browser_plus_folder_form();

  // Maintain the order of the other form items.
  $form['upload']['#weight'] = 0;
  $form['submit']['#weight'] = 2;

  // Add an additional form submission callback that fires after the default.
  $form['#submit'][] = 'media_browser_plus_submit';
}