You are here

function filehash_field_formatter_settings_form in File Hash 7

Implements hook_field_formatter_settings_form().

File

./filehash.module, line 220
Generate hashes for each uploaded file.

Code

function filehash_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $names = filehash_names();
  $options = array();
  foreach (filehash_algos() as $algo) {
    $options[$algo] = $names[$algo];
  }
  $element['algo'] = array(
    '#title' => t('Hash algorithm'),
    '#type' => 'select',
    '#default_value' => $instance['display'][$view_mode]['settings']['algo'],
    '#options' => $options,
  );
  return $element;
}