You are here

function mediafield_field_instance_settings_form in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 modules/mediafield/mediafield.module \mediafield_field_instance_settings_form()
  2. 7.2 modules/mediafield/mediafield.module \mediafield_field_instance_settings_form()

Implements hook_field_instance_settings_form().

File

modules/mediafield/mediafield.module, line 40
Provide a "Multimedia asset" field.

Code

function mediafield_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;
}