You are here

function media_browser_plus_form_media_add_upload_multiple_alter in Media Browser Plus 7

Same name and namespace in other branches
  1. 7.2 media_browser_plus.module \media_browser_plus_form_media_add_upload_multiple_alter()

Implements hook_form_FORM_ID_alter().

File

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

Code

function media_browser_plus_form_media_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();

  // Change the weight of the other form items so they appear in the right order
  $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';
}