You are here

function media_field_instance_settings_form in D7 Media 7

Implements hook_field_instance_settings_form().

File

includes/media.fields.inc, line 37
: Provides a "Multimedia asset" field to the fields API

Code

function media_field_instance_settings_form($field, $instance) {
  $settings = $instance['settings'];

  // Make the extension list a little more human-friendly by comma-separation.
  $extensions = str_replace(' ', ', ', $settings['file_extensions']);
  $form['file_extensions'] = array(
    '#type' => 'textfield',
    '#title' => t('Allowed file extensions for uploaded files'),
    '#default_value' => $extensions,
    '#description' => t('Separate extensions with a space or comma and do not include the leading dot.'),
    '#element_validate' => array(
      '_file_generic_settings_extensions',
    ),
    // By making this field required, we prevent a potential security issue
    // that would allow files of any type to be uploaded.
    '#required' => TRUE,
    '#maxlength' => 255,
  );
  return $form;
}