You are here

function media_page_multiedit in D7 Media 7

Menu callback; presents the Media editing form for multiple file entities.

1 string reference to 'media_page_multiedit'
media_menu in ./media.module
Implement of hook_menu().

File

includes/media.pages.inc, line 38
Common pages for the Media module.

Code

function media_page_multiedit($files) {
  if (!module_exists('multiform')) {
    drupal_set_message(t('To edit multiple media items, you must install the multiform module.'));
  }
  $i = 0;
  $forms = array();
  foreach ($files as $file) {

    // To maintain unique form_ids, increment this counter.
    // @see media_forms().
    $i++;
    $forms[] = array(
      "media_edit_{$i}",
      $file,
    );
  }
  $form = call_user_func_array('multiform_get_form', $forms);
  $form['#attributes']['class'][] = 'media-multiedit-form';
  unset($form['buttons']['Delete']);

  // Would be nice to add this to show a message, but not working.
  // Can debug.

  //$form['buttons']['Save']['#submit'][] = 'media_page_multiedit_submit';
  drupal_set_title(t('Editing multiple media files'));
  return $form;
}